javascript - In iframe how to "unwrap" span tags -
how unwrap span tags within iframe.
<span id="trans001" class="newtext">directional</span>
i tried remove using $('iframe').contents().find(".newtext").unwrap();
if remove()
means works content removed. want retain text.
thanks in advance.
you can use replacewith instead.
$('iframe').load(function () { var $newtext = $('iframe').contents().find(".newtext"); $newtext.replacewith( $newtext.text() ) });
the window load event executes bit later when complete page loaded, including frames, objects , images.
Comments
Post a Comment