I've checked out plenty of other questions but still no luck.
I'm working on my local machine in chrome.
I've got welcome.html (main page) and test.html (iframe page) then I have my style.css.
The Goal: Have my test.html as an iframe inside my welcome.html page. But have the iframe (test.html) be styled using jQuery.
So I have this in my welcome.html
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var $head = $("iframe").contents().find("head");
$head.append($("<link>", { rel: "stylesheet", href: "style.css", type: "text/css" }));
});
</script>
and then this inside the body tag
<iframe name='iframe' id="iframe" src="test.html"></iframe>
iframe is working but no styles are being attached when I inspect the iframe.