Currently, I am developing a straightforward script.
Firstly, here is all of the code that I have:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
function SuperWebF1() {
$("#outerdiv").css({"border":"2px solid #e39f9f"});
alert('SportsDirect.bg: Please specify your desired color first!');
}
</script>
<div id="outerdiv">
<iframe src="http://beta.sportsdirect.bg/checkout/onepage/" id="inneriframe" scrolling="no" target="_parent"></iframe>
</div>
The iframe contains this button:
<button type="button" class="button" onclick="parent.SuperWebF1();">Click me</button>
When the button within the iframe is clicked, I want to change the CSS of the div containing the iframe.
It's important to note that the jQuery code is invoked externally and before the iframe.
How can I achieve this functionality or what mistake am I making in my example?