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

Popular posts from this blog

java - Incorrect order of records in M-M relationship in hibernate -

command line - Use qwinsta in PowerShell ISE -

php - I want to create a website for polls/survey like this http://www.poll-maker.com/ -