Using jQuery to replace an element including all HTML tags
Let's assume I have the correct position of the element. What's the way to replace all the html including the tags of a given HTML block using jQuery ()? I want to do something similar to the following. Is this a good way to do it? What other methods are available or helpful to review?
var location = 'td[id^="A0.R0.Work"]';
var element = jQuery(location).prev();
element.html('<h1>some code</h1>');
Thank.
+3
source to share