Does anyone know of a good tutorial or have an example of how to assign onmouseover events to IDs or Tags, without having the onmouseover code within each and every tag.
Thanks!
Calling onmouseover by ID or tag
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If memory serves:
Code: Select all
var o = document.getElementById('foo');
if (o)
{
o.onmouseover = function(){alert('yay!');}
}Do you know how you could apply this only to an element that is within another? Here is the situation, I have several list elements on my page, but I only want this even to effect one specific list.. which is contained within a div that has an ID.. and the elements that will have the moseover are li's.
Thanks!
Thanks!