javascript - Replace HTML between two tags -
what want replace in between 2 html tags.
i'm using reference i'm still encountering problems: reference
this i've tried:
el.getvalue().replace(/<form.+<\/form>/, "<div></div>");
i need replace form tags dynamically.
if use jquery, retrieve parent element of you'd replaced, , replace content .html()
function.
ex:
var formparentelement = $('#formparentelement'); formparentelement.html("<div>my new content</div>");
if don't use jquery:
var formparentelement = document.getelementbyid("formparentelement"); formparentelement.innerhtml = "<div>my new content</div>";
the example assumes parent element of form has id value "formparentelement".
Comments
Post a Comment