Objekt odeslání vstupu HTML DOM
Zadejte objekt Odeslat
Objekt Input Submit představuje HTML element <input> s type="submit".
Přístup k objektu odeslání vstupu
K prvku <input> můžete přistupovat s type="submit" pomocí getElementById():
Příklad
var x = document.getElementById("mySubmit");
Tip: <input type="submit"> můžete také získat prohledáním kolekce prvků formuláře.
Vytvořte objekt pro odeslání vstupu
Element <input> můžete vytvořit s type="submit" pomocí metody document.createElement():
Příklad
var x = document.createElement("INPUT");
x.setAttribute("type", "submit");
Zadejte vlastnosti objektu Odeslat
Property | Description |
---|---|
autofocus | Sets or returns whether a submit button should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a submit button |
disabled | Sets or returns whether the submit button is disabled, or not |
form | Returns a reference to the form that contains the submit button |
formAction | Sets or returns the value of the formaction attribute of a submit button |
formEnctype | Sets or returns the value of the formenctype attribute of a submit button |
formMethod | Sets or returns the value of the formmethod attribute of a submit button |
formNoValidate | Sets or returns whether the form-data should be validated or not, on submission |
formTarget | Sets or returns the value of the formtarget attribute of a submit button |
name | Sets or returns the value of the name attribute of a submit button |
type | Returns which type of form element the submit button is |
value | Sets or returns the value of the value attribute of the submit button |
Standardní vlastnosti a události
Objekt Input Submit také podporuje standardní vlastnosti a události .
Související stránky
HTML výukový program: HTML formuláře
HTML reference: HTML tag <input>
HTML reference: HTML <input> typ atributu