Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overwrite method of tag in script

Status
Not open for further replies.

Fakhar

Programmer
Feb 11, 2001
2
PK
Hi
I want to overwrite onmouseout method of a div in javascript. How am I going to implement it ? The approach I am using is as follows

<HTML>
<HEAD>
</HEAD>
<BODY>
<DIV id=div1 style=&quot;width:200;height:100&quot;>
</DIV>
<SCRIPT>
document.div1.style.onmouseout = &quot;alert('Hello')&quot;;
</SCRIPT>
</BODY>
</HTML>

This thing doesn't work
 
Try:

<DIV id=div1 style=&quot;width:200;height:100;&quot; onMouseout=&quot;alert('Hello')&quot;> Ivan Pavlov (ip@thehyper.net)

Brainbench MVP for JavaScript
 
to achieve it via script versus inline definition:

div1.onmouseout = someFunc

with no ()'s, then in someFunc perform your tasks jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top