Skip to content Skip to sidebar Skip to footer

Understanding Dom0 Event Model Of Javascript

I am trying to express what I understood from reading some articles about dom0 event model in javascript.If there is a mistake in it ,please correct me. In dom0 model,an event hand

Solution 1:

Seems about right.

You might want to read: http://www.cross-browser.com/talk/event_interface_soup.php http://en.wikipedia.org/wiki/DOM_events#Traditional_model

and for the code in the traditional model you should have a a window.onload event

so

window.onload = function () {

    var el = document.getElementById('hellolink');
    if (el) {
        el.onclick = hello;
    }
};

depending on what browser you are using function hello might receive the element object, so maybe it'll easier for you if you use something like jQuery to handle your dom events.

http://api.jquery.com/click/

Post a Comment for "Understanding Dom0 Event Model Of Javascript"