i have this code on index.html
<body>
<iframe id=iframetest src="alt.html">
<p>Your browser does not support iframes.</p>
</iframe>
<script>
$(window).load(function(){
document.getElementById('iframetest').contentWindow.myFunction();
});
</script>
<button onclick="myFunction();">Click Me</button>
</body>
and this 1 is in alt.html
<head>
<title>JavaScript Test</title>
<script type="text/javascript">
//When click on the button function will run
function myFunction(){
alert("Hello World");
}
</script>
</head>
<body>
<h1>TEST</h1>
</body>
i want to display alert in index.html. but this was not worked.how can i do this? pleas help me
thank you!