Home >Web Front-end >HTML Tutorial >Detailed description of common events and methods of html text_HTML/Xhtml_Web page production

Detailed description of common events and methods of html text_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:40:571649browse
Event Description
onactivate: Triggered when the object is set as an active element.
onafterupdate: Triggered on the data binding object when the associated object in the data source object is successfully updated.
onbeforeactivate: Triggered immediately before the object is set to the current element.
onbeforecut: Triggered on the source object before the selection is deleted from the document.
onbeforedeactivate: Triggered immediately before activeElement changes from the current object to another object in the parent document.
onbeforeeditfocus: Triggered before the object contained in the editable element enters the user interface activation state or before the editable container becomes the control selection area.
onbeforepaste: Triggered on the target object before the selected area is pasted from the system clipboard to the document.
onbeforeupdate: Triggered on the data binding object before the associated object in the data source object is successfully updated.
onblur: Triggered when the object loses input focus.
onchange: Triggered when the content of the object or selected area changes.
onclick: Triggered when the user clicks the object with the left mouse button.
oncontextmenu: Triggered when the user right-clicks the client area to open the context menu.
oncontrolselect: Triggered when the user is about to create a control selection area for the object.
oncut: Fires on the source element when an object or selection is removed from the document and added to the system clipboard.
ondblclick: Fired when the user double-clicks the object.
ondeactivate: Triggered when activeElement changes from the current object to another object in the parent document.
ondrag: Continuously triggered on the source object when a drag operation is performed.
ondragend: Fires on the source object when the user releases the mouse after the drag operation ends.
ondragenter: Triggered on the target element when the user drags the object to a legal drag target.
ondragleave: Triggered on the target object when the user moves the mouse out of the legal drag target during the drag operation.
Ondragover: Continuously triggers on the target element when the user drags the object across the legal drag target.
ondragstart: Triggered on the source object when the user starts dragging the text selection area or selected object.
ondrop: Fires on the target object when the mouse button is released during a drag operation.
onerrorupdate: Triggered on the data binding object when an error occurs when updating the associated data in the data source object.
onfilterchange: Fired when a visual filter changes state or completes a transition.
onfocus: Fired when the object gains focus.
onfocusin: Fires before the element is about to be set as focus.
onfocusout: Triggered on the element that currently has focus immediately after moving focus to other elements.
onhelp: Triggered when the user presses the F1 key when the browser is the current window.
onkeydown: Fired when the user presses a keyboard key.
onkeypress: Fired when the user presses a literal key.
onkeyup: Fired when the user releases a keyboard key.
onlosecapture: Triggered when the object loses mouse capture.
onmousedown: Fired when user clicks on an object with any mouse button.
onmouseenter: Fired when the user moves the mouse pointer into the object.
onmouseleave: Fired when the user moves the mouse pointer outside the bounds of the object.
onmousemove: Triggered when the user moves the mouse over the object.
onmouseout: Fired when the user moves the mouse pointer out of the object boundary.
onmouseover: Fired when the user moves the mouse pointer into the object.
onmouseup: Fires when the user releases the mouse button while the mouse is over an object.
onmousewheel: Fired when the mouse wheel button is rotated.
onmove: Triggered when the object moves.
onmoveend: Fired when the object stops moving.
onmovestart: Fired when the object starts moving.
onpaste: Fires on the target object when the user pastes data to transfer data from the system clipboard to the document.
onpropertychange: Fired when a property change occurs on the object.
onreadystatechange: Triggered when the object state changes.
onresize: Triggered when the size of the object is about to change.
onresizeend: Triggered when the user changes the size of the object in the selected area of ​​the control.
onresizestart: Triggered when the user starts to change the size of the object in the selection area of ​​the control.
onselect: Triggered when the currently selected area changes.
onselectstart: Triggered when the object is about to be selected.
ontimeerror: Unconditionally triggered when a specific time error occurs, usually caused by setting a property to an invalid value.

Method description
addBehavior: Attach a behavior to the element.
appendChild: Append a child element to the object.
applyElement: Makes an element a child element or parent element of other elements.
attachEvent: Binds the specified function to an event so that the function is called whenever the event fires on the object.
blur: Makes the element lose focus and triggers the onblur event.
clearAttributes: Remove all tag attributes and values ​​from the object.
click: trigger onclick event to simulate a click.
cloneNode: Copies a reference to an object from the document hierarchy.
componentFromPoint: Returns the position of the object at specified coordinates through a specific event.
contains: Checks whether the given element is contained in the object.
createTextRange: Create a TextRange object for the element.
detachEvent: Unbind the specified function from the event, so that the function will not receive notification when the event is triggered.
dragDrop: Initialize drag event.
fireEvent: Trigger the specified event of the object.
focus: Causes the element to get focus and execute the code specified by the onfocus event.
getAdjacentText: Returns the adjacent text string.
getAttribute: Get the value of the specified tag attribute.
getAttributeNode: Get the attribute object referenced by the attribute.name attribute.
getBoundingClientRect: Get the object bound to the specified TextRectangle object collection.
getClientRects: Get a collection of rectangles describing the content of the object or the layout in the client area. Each rectangle describes a straight line.
getExpression: Get the expression of a given attribute.
hasChildNodes: Returns a value indicating whether the object has child objects.
insertAdjacentElement: Insert an element at the specified position.
insertAdjacentHTML: Inserts the given HTML text into the element at the specified position.
insertAdjacentText: Insert the given text at the specified position.
insertBefore: Insert elements in the document hierarchy.
mergeAttributes: Copies all read/write tag attributes to the specified element.
normalize: Merge adjacent TextNode objects to generate a regular document object model.
releaseCapture: Release the mouse capture of objects in the current document.
removeAttribute: Removes the given tag attribute of the object.
removeAttributeNode: Remove the attribute object from the object.
removeBehavior: The behavior of detaching elements.
removeChild: Remove child nodes from the element.
removeExpression: Remove the expression from the specified attribute.
removeNode: Remove objects from the document hierarchy.
replaceAdjacentText: Replace the adjacent text of the element.
replaceChild: Replace existing child elements with new child elements.
replaceNode: Replace the object with other elements.
scrollIntoView: Scroll the object into the visible range and arrange it to the top or bottom of the window.
select: Highlight the input area of ​​the form element.
setActive: Set the object as the current object without focusing the object.
setAttribute: Set the value of the specified tag attribute.
setAttributeNode: Set the attribute object as part of the object.
setCapture: Sets the mouse capture of objects belonging to the current document.
setExpression: Set the expression of the specified object.
swapNode: Swap the positions of two objects in the document hierarchy.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn