Change iframe content within an element

Posted by user610983 on Stack Overflow See other posts from Stack Overflow or by user610983
Published on 2012-06-24T08:42:09Z Indexed on 2012/06/24 9:15 UTC
Read the original article Hit count: 142

Filed under:
|
|
$(document).ready(function () {
    $('#keywordframe').contents().find("#step12").html('');
    $('#keywordframe').contents().find("#step12").html('11');
    $('#keywordframe').contents().find("#step13").html('');
    $('#keywordframe').contents().find("#step13").html('12');
    $('#keywordframe').contents().find("#step14").html('');
    $('#keywordframe').contents().find("#step14").html('13');
    $('#keywordframe').contents().find("#step15").html('');
    $('#keywordframe').contents().find("#step15").html('14');
});

I try to use the above code to change the content in an iframe, but it is not working. Unless I put alert(''); on top of $('#keywordframe').contents().find("#step12").html('');

if just will take effect. What is the reason for that, anyone could help?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about iframe