In an iframe how to "unfold" span tags
1 answer
You can use replaceWith instead .
$('iframe').load(function () {
var $newText = $('iframe').contents().find(".newtext");
$newText.replaceWith( $newText.text() )
});
The window load event is executed a bit later when the full page is fully loaded, including all frames, objects, and images.
+1
source to share