0

I am working on a project in which I have to load an iframe inside a HTML table and get the text that is written inside a <h2> tag of the iframe. I tried the following code:

var iframes = $('iframe').contents().find("html").html();
alert(iframes);

I also tried some other variations of it that I found, but it didn't work. You can refer this Codepen code.

Does someone know what am I doing wrong? All suggestions are openly welcomed.

Thanks in advance.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
V15HM4Y
  • 1,757
  • 4
  • 26
  • 40

0 Answers0