Get HTML inside iframe using jQuery

后端 未结 10 1188
清歌不尽
清歌不尽 2020-11-27 04:24

Here is my situation.

I have a file called iframe.html, which contains the code to for a image slideshow. The code is somewhat like

<         


        
10条回答
  •  醉话见心
    2020-11-27 05:06

    Try this code:

    $('#iframe').contents().find("html").html();

    This will return all the html in your iframe. Instead of .find("html") you can use any selector you want eg: .find('body'),.find('div#mydiv').

提交回复
热议问题