JavaScript Reference/Javascript Properties/action

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

"action" Example

    
<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>



"action" is applied to

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



"action" Syntax and Note

Note:
Read and write property.
Specifies the form action URL.
    
Syntax:
    
document.getElementById("elementID").action = value
document.all.elementID.action = value // IE only