Hi Avinash,
first create on date object as shown below,
<script type="text/javascript">
var d=new Date();
document.write(d);
</script>
if one or two js statements means, directly write inside events separated by semicolon, if not embed whole code in one function and then call that function through event.
in the above, u have written wrong,
replace this instead,
OnClick = "document.bgColor='yellow'; document.write='red';"
Aug 17, 2010