change iframe content jquery

后端 未结 3 684
半阙折子戏
半阙折子戏 2021-01-03 11:28

I\'d like to change my iframe content but I don\'t understand how


    
        test
        

        
3条回答
  •  离开以前
    2021-01-03 11:43

    Check this Demo jsFiddle

    you have to use load event within the iframe's document and calling out to a load function in the containing document to replace to a body contain.

    jQuery

    $('#frame').load(function() {
      $('#frame').replaceWith('

    hi

    '); });

    HTML

    
    

    Use .replaceWith() jQuery Method.

提交回复
热议问题