How to call and running function javascript in frame one from other frame. This is my script :
My main code:
<frameset id="tes" rows="60,*">
<frame id="frame2" src="../oneframe.php" frameborder="0" allowtransparency="true" marginwidth="0" marginright="0"></frame>
<frame id="frame1" src="../twoframe.php" frameborder="0"></frame>
</frameset>
oneframe.php :
<button type="button" onClick="runFunc()">Running</button>
twoframe.php:
<html>
<head>
<title>tes</title>
<script>
function runFunc() {
var x = document.getElementById('target');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
</script>
</head>
<body>
<div id="target">This is my target</div>
</body
</html>
Anyone can help me ?