HTML-DOM-Formular action-Attribut
Definition und Verwendung
Aktion Eigenschaftssätze oder gibt die action-Attribut des Formulars.
action-Attribut legt fest, wann das Formular abgeschickt wird, wo die Daten gesendet werden.
Grammatik
formObject.action=URL
Browser-Unterstützung
Alle gängigen Browser unterstützen action-Attribut
Beispiele
Beispiele
Gibt URL Anmeldeformular:
<html>
<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname" value="Donald"><br>
Last name: <input type="text" name="lname" value="Duck"><br>
<input type="submit" value="Submit">
</form>
<script>
document.write(document.getElementById("frm1").action);
</script>
</body>
</html>
<body>
<form id="frm1" action="form_action.html">
First name: <input type="text" name="fname" value="Donald"><br>
Last name: <input type="text" name="lname" value="Duck"><br>
<input type="submit" value="Submit">
</form>
<script>
document.write(document.getElementById("frm1").action);
</script>
</body>
</html>
Beispiele für die obigen Ausgangs:
form_action.html
Versuchen »
Form Object