Reputation: 1628
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'?
Upvotes: 0
Views: 2025
Reputation: 655677
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.
Upvotes: 7