Javascript examples for DOM HTML Element:Form
Form action Property - Return the URL for where to send the form data when a form is submitted:
<!DOCTYPE html> <html> <body> <form id="myForm" action="nothing.asp"> First name: <input type="text" name="fname" value="Donald"><br> Last name: <input type="text" name="lname" value="Duck"><br> <input type="submit" value="Submit"> </form>//from w w w . j av a 2 s .com <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myForm").action; document.getElementById("demo").innerHTML = v; } </script> </body> </html>