Geben Sie die Texttyp - Eigenschaft ein
Beispiel
Finden Sie heraus, um welche Art von Formularelement es sich bei dem Textfeld handelt:
var x = document.getElementById("myText").type;
Definition und Verwendung
Die type-Eigenschaft gibt zurück, um welche Art von Formularelement es sich bei einem Textfeld handelt.
Bei einem Textfeld gibt diese Eigenschaft immer "Text" zurück.
Browser-Unterstützung
Property | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Syntax
textObject.type
Rückgabewert
Type | Description |
---|---|
String | The type of form element the text field is |
❮ Textobjekt eingeben