jquery replaceAll() method is used to replace the selected elements with new HTML elements, the syntax is "$(content).replaceAll(selector)"; the parameter "selector" specifies the selected element, and "content" specifies Contains replacement content for HTML tags.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
jquery replaceall() method
replaceAll() method replaces the selected elements with new HTML elements. Syntax format:
$(content).replaceAll(selector)
Description | |
---|---|
content | Required. Specifies the content to be inserted (must contain HTML tags).|
selector | Required. Specifies which element will be replaced.
$(A).replaceAll(B), which means replacing the B element with the A element.
Example 1: Replace the strong element with an a element
Example 2: Replace the last p element Description for the span element
: The:lastselector selects the last element. This selector only uses For selecting a single element
jQuery video tutorial,web front-end video]
The above is the detailed content of What is the use of jquery replaceall method. For more information, please follow other related articles on the PHP Chinese website!