Reputation: 33
I am new to web development.I have loaded an external webpage into my website and i want to manipulate the HTML of that page. I want to hide the button with the id "sharepopup" in the code below. But it is not working. What am I doing wrong
<div id="content" >
<object type="type/html" data=http://credihealth.com>
</object>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#sharepopup").hide();
});
</script>
Upvotes: 0
Views: 294
Reputation: 943564
You can't access the DOM of third party websites. That would be a security risk.
You can use postMessage
to communicate between cooperating websites on different origins (although I don't know if it works when using <object>
instead of <iframe>
).
Upvotes: 1