Change HTML of an iFrame with jQuery?

前端 未结 4 2149
无人及你
无人及你 2020-11-29 06:24

Is there a way to manipulate the HTML of an iframe that is from the same domain using jQuery?

Thanks for the help.

4条回答
  •  青春惊慌失措
    2020-11-29 07:07

    If you want to change the contents inside the tag of the iframe, you can use this code:

    $("#iframe_id").contents().find("body").html('my_new_content');
    

提交回复
热议问题