Javascript examples for DOM HTML Element:Button
Button formTarget Property - returning the formTargert property:
<!DOCTYPE html> <html> <body> <form action="#" method="get"> First name: <input type="text" name="fname" value="Mary"><br> Last name: <input type="text" name="lname" value="Bond"><br> <button type="submit">Submit</button> <button id="myBtn" type="submit" formtarget="_blank">Submit to a new window/tab</button> </form>//w w w . j a va2s .c o m <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myBtn").formTarget; document.getElementById("demo").innerHTML = x; } </script> </body> </html>