Reputation: 1
<html>
<body>
<style type="text/css">
</style>
<iframe src="http://connectotravel.com/" height="100%" width="100%" id="frame"> </iframe>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$.frameReady( function() {
);
</script>
</body>
</html>
What I want to do is to change the background color within this iframe using jquery. Any help will do.
Upvotes: 0
Views: 222
Reputation: 9472
You can do it with contents API of Jquery library
Just add this with in the script tag ( you please change the colour code with your desired colour number )
$( document ).ready(function() {
$("#frame").contents().find("body").css("background-color", "#BADA55");
});
If this didnt work you can also try by finding html element itself
$( document ).ready(function() {
$("#frame").contents().find("html").css("background-color", "#BADA55");
}
References : - Iframe content access via jquery
Upvotes: 1