HTML -onsubmit- Attribut
Definition und Verwendung
Das onsubmit
Attribut wird ausgelöst, wenn ein Formular gesendet wird.
Gilt für
Das onsubmit
Attribut ist Teil der Ereignisattribute und kann für das folgende Element verwendet werden:
Elemente | Fall |
---|---|
<Formular> | einreichen |
Beispiel
Führen Sie ein JavaScript aus, wenn ein Formular gesendet wird:
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>
Browser-Unterstützung
Event Attribute | |||||
---|---|---|---|---|---|
onsubmit | Yes | Yes | Yes | Yes | Yes |