UK[ˈækʃn] US[ˈækʃən]

n.Action, activity; function, role; means; [Law] litigation

Third person singular: actions Plural: actions Present participle: actioning past tense: actioned

javascript action attribute syntax

Function: Set or return the action attribute of the form.

Syntax: formObject.action=URL

javascript action attribute example

<html>
<head>
<script type="text/javascript">
function changeAction()
{
var x=document.getElementById("myForm")
alert("表单action: " + x.action)
x.action="/course"
alert("表单新action: " + x.action)
x.submit()
}
</script>
</head>
<body>

<form id="myForm" action="/index.php">
名称:<input type="text" value="米老鼠" />
<input type="button" onclick="changeAction()"
value="改变 action 属性并提交表单" />
</form>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance