$(content).replaceAll(selector)
".replaceAll()" method is used to replace the selected elements with the specified content.
Note: The difference between replaceAll() and replaceWith() is that, replaceAll replaces the specified content for the all the selected element, where replaceWith replaces the specified content for the selected element only.
The below example replaces the specified content for the selected elements.