Current location - Quotes Website - Signature design - What is javascript event flow? What is an event stream?
What is javascript event flow? What is an event stream?
Event flow describes the order in which the page receives events, IE adopts event bubble flow, and the standard adopts event capture flow. Finally, addEventLister gives a third parameter that supports both bubbling and capture.

Common events mainly include:

(1) Click the event: onclick. Event is generated when the user clicks the mouse button, and at the same time. The event handler or code specified by nclick will be called to execute.

(2) Change event: onchange. This event occurs when the character value in a text or textarea element changes or the state of the select table option changes.

(3) Select the event: onselect. This event is raised when text in a text or textarea object is selected. For example:

& ltipnuttype = "text" value = "default information" on select = alert ("you selected the text in the t text box") >

(4) Get the focus event: onfocus. This event is generated when the user clicks a text or text area and selects an object, that is, when the cursor falls on a text box or a selection box. For example:

& ltSelect name = "Jian Zheng" onfocus = alert ("I become the focus") >

(5) Out of focus event: onblur. An event that loses focus is just the opposite of an event that gains focus. This event is raised when the text or textarea and the selected object no longer have focus and exit the background.

(6) Manned file event: onload, which is generated when a manned page file is loaded. One function of onload is to detect the value of cookie when the page file is manned for the first time, and assign a value to it with a variable, so that it can be used by the source code. This event is an event of window, but when an event handler is specified in HTML, it is usually used.

& ltBodionload = alert ("Loading page, please wait") >

(7) Unload file event: onunload. There is also a manned document incident. On the other hand, Nload is an event that is triggered when a web page exits and can be updated. Ookie's status. For example:

& lt bodyunload = confirm ("Are you sure you want to leave this page?" )& gt

(8) The mouse is capped with onmouseover, which is an event triggered when the mouse is on the element. For example:

& ltinput type = " boutton " value = " button " onmouseover = " window。 Status=' =' Please pay attention to the status bar below. return true " & gt

(9) The mouse leaves onmouseout, onmouseout, which is an event raised when the mouse leaves the element. If used with the mouse overlay event, you can create the effect of a dynamic button.

(10) General events.

Ondbclick: mouse double click event.

Onkeypress: Event triggered when a key on the keyboard is pressed and released, which requires that there must be an active object in the page.

Onkeydown: Event triggered when a key on the keyboard is pressed, which requires that there must be an active object in the page.

Onkeyup: Event triggered when a key on the keyboard is released, which requires that there must be an active object in the page.

(1 1) page related events.

Onabort: An event triggered when a picture is interrupted by the user during the downloading process.

Onbeforeunload: Event triggered when the content of the current page is about to change.