I have an iframe and I want to set it’s border to zero.
But I want to do this from inside the iframe, using javascript or jQuery.
How to do this? Many thanks in advance,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the parent is on a different origin, you can’t do it, because access to the parent’s content is forbidden by the Same Origin Policy.
If the parent document is on the same origin, this should do it:
Live example | source of parent | source of frame
Note that it’s important to use
==rather than===when comparing thewindowproperties (unusually,windowis special).