Tags for this article: attributes, dhtml, dynamic, html, onclick, ondblclick, Onmousemove, Onmouseout, onmouseover, Onmouseup, tutorial, xhtml
When setting out to write the dynamic HTML, you’ll need to understand various ways where you will be able to impact the elements on pages. Normally, elements will be able to have one more of following attributes that will indicate an action moment in referencing the page. Once you have decided on when you will want to make the dynamic action to occur, you can add up your scripting language to anyone of these attributes and make the element more dynamic.
Some Notes
The common way to write all these attributes is with the mixed case but with the XHTML, the attributes must be written in lower case. This will mean that OnClick and onclick means same thing but in XHTML, onclick is valid.
Finally, all these attributes are very much valid but not all the browsers will support them in same ways, so you have to be sure to test your own scripts just before releasing them.
Event that are mouse related.
Onclick
Onclick attribute is the one which is commonly used DHTML attributes. This will tell browser to implement all the scripts when element is clicked rightaway with the mouse or with the pointer.
The onclick attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Ondblclick
Just like onclick attribute, this ondblclick attribute will take effect when element is double clicked. This not commonly found on the web pages but will give your WebPages the same functionality as that of OS icon.
The ondclick attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Onmousedown
When the pointer or mouse button is pressed down the element, the onmousedown attribute will activate.
The onmousedown attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Onmouseup
When the pointer or mouse button is released down the element, the onmouseup attribute will activate.
The onmouseup attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Onmousemove
When the pointer or mouse is moved within that element, then the onmousemove attribute will be activated.
The onmousemove attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Onmouseout
When the pointer or mouse is moved off from the element, the onmouseout attribute will be activated.
The onmouseout attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet.
Onmouseover
When the pointer or mouse is moved on to the element, the onmouseover attribute will be activated.
The onmouseover attribute will work with all element but will not work with few and they are title, style, script, param, Meta, isindex, iframe, HTML, head, frameset, frame, font, br, bdo, basefont, base and applet