<html> <head> <script type="text/javascript"> function getAction() { var x=document.forms.myForm alert(x.action) } function changeAction() { var x=document.forms.myForm x.action="default.asp" alert(x.action) } </script> </head> <body> <form name="myForm" action="js_examples.asp"> <input type="button" onclick="getAction()" value="View value of action attribute"> <br /><br /> <input type="button" onclick="changeAction()" value="Change value of action attribute"> </form> </body> </html>
Edit the text above, and click on the button to see the result.
Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.