In one function, having nothing to do with another item, how can I trigger an onmouseover event in javascript on a div with id 'item'?
+6
A:
Simply call the onmouseover
function of that element:
document.getElementById("item").onmouseover()
document.getElementById("item")
refers to the element, elem
.onmouseover
to the function for the mouseover event and appending ()
to it will call that function.
Gumbo
2009-09-17 18:00:20
Unless, you have a container element that relies on event bubbling.
Ates Goral
2009-09-17 19:12:41