English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The replaceAll() method replaces the selected elements with new HTML elements.
The replaceAll() method is similar toreplaceWith()butcontent And selectorInversely.
$(content).replaceAll(selector)
Replace all paragraphs with <h1>Element:
$("button").click(function(){ $("<h1>New Title</h1>").replaceAll("p"); });Test and see‹/›
Parameter | Description |
---|---|
content | Specify the content to be inserted (must contain HTML tags) |
selector | Specify the element to be replaced |