
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Input Submit object property
The HTML DOM Input Submit object is associated with the <input> element with type “submit”. We can create and access an input element with type submit by using the createElement() method and getElementById() method respectively.
Properties
Following are the properties for the Input submit object −
Property | Description |
---|---|
autofocus | To set or return if the submit button should get focus automatically when the page loads or not. |
defaultValue | To set or return the submit button default value. |
disabled | To set or return if the submit button has been disabled, or not. |
form | To return the reference of the form containing the submit button. |
formAction | To set to return the formaction attribute value of a submit button. |
formEnctype | To set or return the formenctype attribute value of a submit button |
formMethod | To set or return the formmethod attribute value of a submit button |
formNoValidate | To set or return if the form data should be validated or not on being submitted. |
formTarget | To set or return the formtarget attribute value of a submit button. |
name | To set or return the name attribute value of the submit button. |
type | To return the form element type for the submit button. |
value | To set or return the value attribute value of a submit button. |
Syntax
Following is the syntax for −
Creating an input submit object −
var P = document.createElement("INPUT"); P.setAttribute("type", "submit");
Example
Let us look at an example for the Input submit object property −
<!DOCTYPE html> <html> <head> <script> function rangeCreate() { var S = document.createElement("INPUT"); S.setAttribute("type", "submit"); document.body.appendChild(S); } </script> </head> <body> <h1>Input submit object</h1> <p>Create an input submit button by clicking the below button</p> <button onclick="rangeCreate()">CREATE</button> <br><br> </body> </html>
Output
This will produce the following output −
On clicking the CREATE button −
- Related Questions & Answers
- HTML DOM Input Submit autofocus property
- HTML DOM Input Submit disabled property
- HTML DOM Input Submit form property
- HTML DOM Input Submit formAction property
- HTML DOM Input Submit formEnctype property
- HTML DOM Input Submit formMethod property
- HTML DOM Input Submit formNoValidate property
- HTML DOM Input Submit formTarget property
- HTML DOM Input Submit name property
- HTML DOM Input Submit type Property
- HTML DOM Input Submit value Property
- HTML DOM Input Button Object
- HTML DOM Input Number Object
- HTML DOM Input FileUpload Object
- HTML DOM Input Hidden Object
Advertisements