[Javascript] How to pass an object to a function

Mike Dougherty mdougherty at pbp.com
Fri May 14 14:30:17 CDT 2004


What should this be to make this work:  (wait 1 second of hovering before firing a method)

<span id='menuitem1' onMouseOver="miOver(this)">hover here</span>

function miOver(obj) {
   timerid = setTimeout("doSomething(" + obj + ")", 1000);
   }

function doSomething(obj) {
   alert(obj.id)
   }



More information about the Javascript mailing list