HTML DOM Atrybut type przycisk INPUT
Definicja i Wykorzystanie
Właściwość type zwraca typ elementów formularza.
typ obiektu Button jest zawsze "button".
gramatyka
buttonObject.type
Pomoc Browser
Wszystkie główne przeglądarki obsługują typ atrybutu
Przykłady
Przykłady
Poniższy przykład powróci do przycisku formą typ elementu:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Ten poradnik (w3big.com) </ title>
<Script>
Funkcja displayResult () {
var x = document.getElementById ( "button1") typu .;
alert (x);
}
</ Script>
</ Head>
<Body>
<Form>
<Input type = "button" onclick = "displayResult ()" value = "display typu przycisku" id = "button1">
</ Form>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Ten poradnik (w3big.com) </ title>
<Script>
Funkcja displayResult () {
var x = document.getElementById ( "button1") typu .;
alert (x);
}
</ Script>
</ Head>
<Body>
<Form>
<Input type = "button" onclick = "displayResult ()" value = "display typu przycisku" id = "button1">
</ Form>
</ Body>
</ Html>
Spróbuj »
przycisk Przedmioty