Hi there.
I am trying to use the World Wide Web Consortium Document Object Model to traverse through a document's body. For elements that match a certain condition, I would like to assign them a mouseover (and mouseout) event handler. But I don't seem to having much luck:
Has anyone got anything similar to work?
Cheers, NEIL
I am trying to use the World Wide Web Consortium Document Object Model to traverse through a document's body. For elements that match a certain condition, I would like to assign them a mouseover (and mouseout) event handler. But I don't seem to having much luck:
Code:
if( node matches some condition ) {
node.setAttribute( 'onmouseover', 'alert("Hello")' );
for( var p in node ) {
if( p.match( /^on/ ) {
alert( p + ": " + node[p] );
}
}
}
Has anyone got anything similar to work?
Cheers, NEIL