Questions tagged [replacewith]

JQuery .replaceWith() method. Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.

JQuery .replaceWith() method. Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.

The .replaceWith() method, like most jQuery methods, returns the jQuery object so that other methods can be chained onto it. However, it must be noted that the original jQuery object is returned. This object refers to the element that has been removed from the DOM, not the new element that has replaced it.

As of jQuery 1.4, .replaceWith() can also work on disconnected DOM nodes.

Source:http://api.jquery.com/replaceWith/

316 questions
-4
votes
2 answers

Javascript replace in a string

I am familiar with the "replace" method in javascript is not enough. Possibly is it for my project is also a better way, then I would be glad if you also tells me this. I would need the following: I have a string with the following content: var…
Thomas
  • 3
  • 1
1 2 3
21
22