HTML-DOM Senden Eigenschaft type
Definition und Verwendung
Typ-Eigenschaft gibt die Bestätigung Formularelement-Typ-Tasten.
Für die Bestätigungstaste ist dieses Attribut immer "Eintragen".
Grammatik
submitObject.type
Browser-Unterstützung
Alle gängigen Browser unterstützen type-Attribut
Beispiele
Beispiele
Das folgende Beispiel gibt die Bestätigungstaste Formularelement Typ:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Titel> Dieses Tutorial (w3big.com) </ title>
<Script>
Funktion displayResult () {
var x = document.getElementById ( "submit1") Typ .;
alert (x);
}
</ Script>
</ Head>
<Body>
<Form>
E-Mail: <input type = "text" id = "email">
<Input type = "submit" id = "submit1">
</ Form>
<Taste type = "button" Onclick = "displayResult ()"> Display input type </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Titel> Dieses Tutorial (w3big.com) </ title>
<Script>
Funktion displayResult () {
var x = document.getElementById ( "submit1") Typ .;
alert (x);
}
</ Script>
</ Head>
<Body>
<Form>
E-Mail: <input type = "text" id = "email">
<Input type = "submit" id = "submit1">
</ Form>
<Taste type = "button" Onclick = "displayResult ()"> Display input type </ button>
</ Body>
</ Html>
Versuchen »
Senden Objekte