hatem_from_mesr
asked on
how to change document background with mousedown event
hi all,
my manager wants me to change the document background with mouse click
the sample does not work with me
could you please correct it for me
best regards
hatem gamal
my manager wants me to change the document background with mouse click
the sample does not work with me
could you please correct it for me
best regards
hatem gamal
<html>
<head>
<title>
JavaScript Event Example
</title>
</head>
<body id="n" name="n" bgcolor="#eeeeee" >
<h1 onmousedown="var obj=document.getElementById("n");obj.bgcolor='#880000';">
Click this page to turn it pink!
</h1>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this is how you can click on the page to change the color
<script>
window.onload=function() { document.onmousedown=funct ion() { document.body.style.backgr oundColor= 'pink' } }
</script>
<script>
window.onload=function() { document.onmousedown=funct
</script>
ok, too late...
ASKER