Javascript examples for DOM HTML Element:IFrame
IFrame name Property - Change the name of an iframe:
<!DOCTYPE html> <html> <body> <iframe id="myFrame" src="/default.asp" name="iframe_a"></iframe> <p>Click the button to change the name of the iframe.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from www .j a v a2 s. co m*/ document.getElementById("myFrame").name = "newIframeName"; document.getElementById("demo").innerHTML = "The name of the iframe was changed from 'iframe_a' to 'newIframeName'."; } </script> </body> </html>