Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!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()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myFrame").name = "newIframeName"; document.getElementById("demo").innerHTML = "The name of the iframe was changed from 'iframe_a' to 'newIframeName'."; } </script> </body> </html>