html - 2 button's open in same iframe with JavaScript -
i want 2 button's open in same iframe. when button 1 active need button 2 empty frame , load link in there. possible? code (so far):
<body> <input type="button" id="knopsql1" type="submit" value="1e klasse"></input> <script> document.getelementbyid('knopsql1').onclick = function() { var iframe = frames[0] || document.createelement('iframe'); iframe.src='http://www.example.com/sql.php'; document.body.appendchild(iframe); }; </script> <input type="button" id="knopsql2" type="submit" value="2e klasse"></input> <script> document.getelementbyid('knopsql2').onclick = function() { var iframe = document.createelement('iframe'); iframe.src='http://www.example.com/sql2.php'; document.body.appendchild(iframe); }; </script> </body>
Comments
Post a Comment