replace

UK[rɪˈpleɪs] US[rɪˈples]

vt. Replace; replace; put... back in place; (use...) replace

with

英[wɪð] 美[wɪθ]

prep.With; and, with; about; consistent with...

jquery replaceWith() method syntax

Function:replaceWith() method replaces the selected element with the specified HTML content or element. replaceWith() has the same effect as replaceAll(). The differences are in the syntax: the content and the position of the selector, and the replaceAll() function cannot be used for replacement.

Syntax:$(selector).replaceWith(content)

##Parameters:

Parameter Description content Required. Specifies the content to replace the selected element. Possible values: HTML code - e.g. ("
") New element - e.g. (document.createElement("div")) Existing element - e.g. ($(".div1")) Existing elements will not be moved, only copied and wrapped around the selected element. selector Required. Specifies the element to be replaced.

Use function to replace elements:Use function to replace selected elements with new content.

Syntax:$(selector).replaceWith(function())

Parameters:

jquery replaceWith() method example

    

This is a paragraph.

This is another paragraph.

Run instance »

Click the "Run instance" button to view the online instance

About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!
Parameters Description function() Required. A function that returns the new content to replace the selected element. ##