Eugene
Eugene

Reputation: 11

How to show just a div in iFrame using jQuery?

Hi I would like to load a page using iFrame on my website. and as a final result I need to hide everything and show just one div's inner text. How can I accomplish it using jQuery? or maybe another workaround

Upvotes: 1

Views: 2248

Answers (2)

user384929
user384929

Reputation:

<b>$("#test").contents().find("#content").setAttribute("style","display:none");</b>

Sorry I believe this is better suited to what your looking to do.

Upvotes: 1

user384929
user384929

Reputation:

Assuming you have

Iframe contains div with id='someID':

<div id="someID">Hello world!</div>

Use the following to access the HTML

$('#iframeID').contents().find('#someID').style('display:none;');

Upvotes: 2

Related Questions