Get HTML inside iframe using jQuery

后端 未结 10 1170
清歌不尽
清歌不尽 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 04:59

    If you have Div as follows in one Iframe

     
    

    Then you can find the text of those Div using the following code

    var iContentBody = $("#ifrmReportViewer").contents().find("body");
    var endLetterSequenceNo = iContentBody.find("#EndLetterSequenceNoToShow").text();
    
    var divInnerFormText = iContentBody.find("#divInnerForm").text();
    

    I hope this will help someone.

提交回复
热议问题