JavaScript events
1. Click event onclick
Obtn.click=function () {};
2. Move-in/move-out event Onmouseover/onmouseout Note: This event is also triggered when you move in and out of the parent and into the child.
Obtn.mouseover=function () {}
3. Mouse Press/Lift Onmousedown/onmouseup
Obtn.onmousedown=function () {}
3. Move-in/move-out event Onmouseenter/onmouseleave Note: Moving in and out of the parent, entering the child, does not trigger this event
Obtn.mouseleave=function () {}
4. Get/Lose Focus Onfocus/onblur
Obtn.onfocus=function () {}
5. Keyboard events Press/Lift onkeydown/onkeypress
Obtn.onkeydown=function (event) {
var Num=event.keycode;
};
Note: The value of the Event.keycode
9 tab
Enter
20 CAPS Lock
32 Space Key
37 left
38 on
39 Right
40 down
6. Bind Event/Unbind
Google Firefox Obtn.addeventlistener ("event", "Callback function", false);
Obtn.removeeventlistener ("Event", "Callback function", false);
Note: False only listens for events that are bubbling
IE9 obtn.attachevent ("event", "callback function");
Obtn.detachevent ("Event", "callback function");
7. Roller event Onmousewheel/dommousescroll (Firefox)
8. Block Bubbling Events
Event.stoppropagation () block event bubbling non ie
Return False;ie
8. Block Default Events
Event.preventdefault () block default events non IE
Return False;ie
Cond.....
Talk about JavaScript events