Detailed description of common events and methods of html text

Detailed description of common events and methods of html text
Event Description
onactivate: Fired when the object is set as the active element.
onafterupdate: Triggered on the data-bound object after the associated object in the data source object is successfully updated.
onbeforeactivate: Fires immediately before the object is set as the current element.
onbeforecut: Fires on the source object before the selected area is deleted from the document.
onbeforedeactivate: Triggered immediately before activeElement changes from the current object to other objects in the parent document.
onbeforeeditfocus: Triggered before an object contained in an editable element enters the user interface active 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-bound 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 an 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 make a control selection 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: Triggered when the user double-clicks the object.
ondeactivate: Triggered when the activeElement changes from the current object to another object in the parent document.
ondrag: Fires continuously on the source object while a drag operation is in progress.
ondragend: Fired on the source object when the user releases the mouse at the end of the drag operation.
ondragenter: Fired on the target element when the user drags an object to a valid drag target.
ondragleave: Fired on the target object when the user moves the mouse out of a legal drag target during a drag operation.
ondragover: Triggered continuously on the target element when the user drags the object over a legal drag target.
ondragstart: Triggered on the source object when the user starts dragging a text selection 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 in updating the associated data in the data source object.
onfilterchange: Fired when a visual filter changes state or completes a transition.
onfocus: Triggered when the object gains focus.
onfocusin: Fires before an element is set to focus.
onfocusout: Fires on the currently focused element immediately after moving focus to another element.
onhelp: Triggered when the user presses the F1 key while the browser is the current window.
onkeydown: Triggered when the user presses a keyboard key.
onkeypress: Fired when the user presses a literal key.
onkeyup: Triggered when the user releases a keyboard key.
onlosecapture: Triggered when the object loses mouse capture.
onmousedown: Fired when the user clicks the object with any mouse button.
onmouseenter: Fired when the user moves the mouse pointer into an object.
onmouseleave: Triggered when the user moves the mouse pointer out of the object's boundaries.
onmousemove: Triggered when the user moves the mouse over the object.
onmouseout: Triggered when the user moves the mouse pointer out of the object's boundaries.
onmouseover: Fired when the user moves the mouse pointer into an object.
onmouseup: Fired when the user releases the mouse button while the mouse is over the object.
onmousewheel: Triggered when the mouse wheel button is rotated.
onmove: Triggered when the object moves.
onmoveend: Triggered when the object stops moving.
onmovestart: Triggered when the object starts moving.
onpaste: Triggered 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 an object.
onreadystatechange: Triggered when the object state changes.
onresize: Triggered when the size of an object is about to change.
onresizeend: Triggered when the user finishes changing 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 selected area of ​​the control.
onselect: Triggered when the current selected area changes.
onselectstart: Triggered when the object is about to be selected.
ontimeerror: Fires unconditionally when a specific time error occurs, usually caused by setting a property to an invalid value.

Method Description
addBehavior: Add a behavior to an element.
appendChild: Append a child element to the object.
applyElement: Makes an element a child or parent of another element.
attachEvent: Binds a specified function to an event so that the function is called whenever the event is triggered on the object.
blur: causes the element to lose focus and triggers the onblur event.
clearAttributes: Removes all tag attributes and values ​​from an object.
click: Triggers the onclick event to simulate a click.
cloneNode: Copies a reference to an object from the document hierarchy.
componentFromPoint: Returns the position of an object at the specified coordinates through a specific event.
contains: Checks whether an object contains a given element.
createTextRange: Creates a TextRange object for an element.
detachEvent: Unbind the specified function from the event so that the function will not receive a notification when the event is triggered.
dragDrop: Initialize the drag event.
fireEvent: triggers the specified event of the object.
focus: Gives the element focus and executes the code specified by the onfocus event.
getAdjacentText: Returns the adjacent text string.
getAttribute: Get the value of the specified tag attribute.
getAttributeNode: Gets the attribute object referenced by the attribute.name attribute.
getBoundingClientRect: Gets the object bound to the specified TextRectangle object collection.
getClientRects: Gets a collection of rectangles that describe the content of an object or the layout of the client area. Each rectangle describes a line.
getExpression: Gets the expression for 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: Inserts the given text at the specified position.
insertBefore: Insert an element into the document hierarchy.
mergeAttributes: Copies all read/write tag attributes to the specified element.
normalize: Merge adjacent TextNode objects to produce a regular document object model.
releaseCapture: Releases the mouse capture of objects in the current document.
removeAttribute: Removes the given tag attribute from an object.
removeAttributeNode: Deletes an attribute object from an object.
removeBehavior: The behavior of removing an element.
removeChild: Removes a child node from an element.
removeExpression: Removes an expression from the specified attribute.
removeNode: Removes an object from the document hierarchy.
replaceAdjacentText: Replaces the adjacent text of an element.
replaceChild: Replaces an existing child element with a new child element.
replaceNode: Replace an object with another element.
scrollIntoView: Scrolls the object into the visible range and arranges it at the top or bottom of the window.
select: Highlights the input area of ​​a form element.
setActive: Sets the object as the current object without setting the object as the focus.
setAttribute: Sets the value of the specified tag attribute.
setAttributeNode: Sets the attribute object as part of the object.
setCapture: Sets the mouse capture for objects belonging to the current document.
setExpression: Sets the expression of the specified object.
swapNode: Exchanges the positions of two objects in the document hierarchy.

<<:  CSS3 realizes the website product display effect diagram

>>:  Detailed explanation of MySQL three-value logic and NULL

Recommend

Example of how nginx implements dynamic and static separation

Table of contents Deploy nginx on server1 Deploy ...

DOCTYPE Document Type Declaration (Must-Read for Web Page Lovers)

DOCTYPE DECLARATION At the top of every page you w...

MYSQL A question about using character functions to filter data

Problem description: structure: test has two fiel...

Detailed explanation of React component communication

Table of contents Component Communication Introdu...

MySQL 5.7.17 installation and configuration tutorial for Mac

1. Download MySQL Click on the official website d...

MySQL green decompression version installation and configuration steps

Steps: 1. Install MySQL database 1. Download the ...

Detailed explanation of MySQL Truncate usage

Table of contents MySQL Truncate usage 1. Truncat...

How to configure nginx to return text or json

Sometimes when requesting certain interfaces, you...

MySQL optimization tutorial: large paging query

Table of contents background LIMIT Optimization O...

How to build a deep learning environment running Python in Docker container

Check virtualization in Task Manager, if it is en...

Vue's vue.$set() method source code case detailed explanation

In the process of using Vue to develop projects, ...

MySQL 8.0.11 installation and configuration method graphic tutorial (win10)

This article records the installation and configu...