It is necessary to find the element (link) in the nested iframe structure. How many there will be iframe is unknown, possible tree structure. How to implement it on jQuery or in any other way on JS?

  • And why look for him. They are all in document.frames - nick_n_a
  • Scan document.links , document.frames[].links Links and frames embedded - nick_n_a
  • document.frames - returns undefinded, chrome 51. - Sergey Matiychuk
  • and what iframe? at least from the same site (domain)? - Ivan Pshenitsyn

1 answer 1

Here look:

 $(function(){ var iFrameDOM = $("iframe#someID").contents(); //Теперь мы можем использовать find() для доступа к элементам iframe: //например iFrameDOM.find(".message").slideUp(); }); 

And then on the main ...

  • The problem is that I do not know how many iframe are there and in which of them my link is located. Is there any library that allows you to automatically check all nested iframes? - Sergey Matiychuk
  • What prevents you from counting all the iframe on the page, and see using jQuery on them to run? - Oma