Unit - 2 WEB PROGRAMMING
Unit - 2 WEB PROGRAMMING
Programming
Unit – II
DOM and DOM Events:
Accessing and modifying DOM,
Events and Event Handlers -
Load, Mouse, Synthetic Events,
Key and Form Related Events,
Event Bubbling, Cookies
DOM
• The mouseout fires when the mouse cursor is over an element and
then moves another element.
• The mouseenter fires when the mouse cursor is outside of an
element and then moves to inside the boundaries of the element.
• The mouseleave fires when the mouse cursor is over an element and
then moves to the outside of the element’s boundaries.
• Both mouseenter and mouseleave does not bubble and does not fire
when the mouse cursor moves over descendant elements.
Event Handlers
• Key
• Keydown ; Keyup; Keypress
• Keydown is pressing the key without releasing
it, Keypress is a complete press-and-release cycle.
• Keydown event is fired for all keys, regardless of
whether they produce a character value.
• The keydown
• and keyup events provide a code indicating which key is
pressed, while keypress indicates which character was
entered.
Event Handlers
Form Related Events
• A form event is fired when a form control receive or loses
focus or when the user modify a form control value such as
by typing text in a text input, select any option in a select
box etc.