0

I need to change the iframe url css styles

<iframe id="anil" width="400" height="480" src="https://getbootstrap.com/docs/3.3/examples/starter-template/"></iframe>

Tried it using jquery but couldn't solve it

$("iframe").contents().find("body").css("background-color","yellow");
2
  • You can't do this if the page loaded into the frame is on a different domain. developer.mozilla.org/en-US/docs/Web/Security/… Commented Dec 5, 2017 at 11:18
  • Unless you own getbootstrap.com there's no chance of that happening. Commented Dec 5, 2017 at 11:49

1 Answer 1

1

You can not access by javascript the content of an iframe for security reasons.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.