Hide a div id or class in html iframe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
altabmw01
Forum Newbie
Posts: 3
Joined: Fri Dec 02, 2016 2:50 pm

Hide a div id or class in html iframe

Post by altabmw01 »

Just save this html code as a index.html and run this code in your browser. You can see bing layout. Now i need to hide videos menu which is in the #scpt2. So please help me.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>iframe</title>
</head>
<body>
<iframe src="http://www.bing.com" style="width: 90%; height: 300px"></iframe>
</body>
</html>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Hide a div id or class in html iframe

Post by Christopher »

You will probably get a cross-site scripting error -- as you should for security. You cannot access Javascript on a frame or window in another domain.

For code examples, search for "accessing elements in iframe"
(#10850)
Post Reply