JavaScript Reference/Javascript Properties/action

Материал из Web эксперт
Перейти к: навигация, поиск

"action" Example

   <source lang="javascript">
   

<html> <head> <script> function sending() {

   document.all.myForm.action = "yourpage.asp";
   document.all.myForm.submit(); 

} </script> </head> <body> <form id="myForm"> Full Name: <input type="text" name="fullname" value=""> <button onclick="sending();">Submit</button> </form> </body> </html>


     </source>
   
  


"action" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<form> <isindex> | +----------------+--------------------------------------------------------------+

     </source>
   
  


"action" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Specifies the form action URL.

Syntax:

document.getElementById("elementID").action = value document.all.elementID.action = value // IE only


     </source>