Well I got the most basic question. I want to select the iframe within the div. And when this iframe is clicked no matter where, I want to remove the iframe. How can I do this?
<div id="box">
Random thoughts
<iframe src=""></iframe>
</div>
See here: http://jsfiddle.net/nT4uZ/1/
Try Online
Try to use that script, hope it can help you :)
You cannot directly handle the click inside of an iframe as correctly @Daedalus commented.
You need top put an extra div inside the
#box
div which it will cover the iframe and it will handle the click above the iframe.You need to find the dimensions of the iframe and its offset and apply those in this div.
HTML
CSS
JavaScript (with some help from the link here)
Here is a fiddle with the code.