-2

Here is what i am trying to achieve with jQuery.

I have website and there is iframe in one of the pages.

When i try to check if element is visible on a page i check like this:

if($('.tabContentContainer').is(':visible')) {
  RunFunction(1);
}

But when the element is inside an iframe i can not check if it is visible, why ?

Is it possible to check if element is visible inside iframe and if so how ?

Also i would like to know how to select the second loaded iframe on the page. All of the iframes do not have classes or IDs of the elements so i can't select it by them.

Liam
  • 27,717
  • 28
  • 128
  • 190
Venelin
  • 2,905
  • 7
  • 53
  • 117
  • Could you please share the website? Or the piece of dom you want to inspect with jquery? – Giulio Ambrogi May 23 '17 at 11:07
  • Possible duplicate of [jQuery/JavaScript: accessing contents of an iframe](https://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe) – André Dion May 23 '17 at 11:09

1 Answers1

0

you can use contents() method of jquery. something like:

$("#your-iframe-id").contents().find('.class-you-want-to-check').is(':visible')
pranay kumar
  • 404
  • 3
  • 8