Javascript examples for DOM HTML Element:Button
Button formAction Property - returning the formAction 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><br> <button id="myBtn" type="submit" formaction="/action_page2.php">Submit to another page</button> </form>/*from www .ja v a 2 s . c om*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myBtn").formAction; document.getElementById("demo").innerHTML = x; } </script> </body> </html>