
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Color form Property
The Input Color form property returns the reference of enclosing form for input color.
Syntax
Following is the syntax −
- Returning reference to the form object
inputColorObject.form
Example
Let us see an example of Input Color form property −
<!DOCTYPE html> <html> <head> <title>Input Color Form</title> </head> <body> <form id="formForColorsInput"> Color Picker: <input type="color" id="Color" > </form> <button onclick="getFormID()">Get Form ID</button> <div id="divDisplay"></div> <script> function getFormID() { var inputColor = document.getElementById("Color"); var divDisplay = document.getElementById("divDisplay"); divDisplay.textContent = 'Form ID for color input: '+inputColor.form.id; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Get Form ID’ button −
After clicking ‘Get Form ID’ button −
- Related Articles
- HTML DOM Input Color autofocus Property
- HTML DOM Input Color defaultValue Property
- HTML DOM Input Color disabled Property
- HTML DOM Input Color name Property
- HTML DOM Input Color type Property
- HTML DOM Input Color value Property
- HTML DOM Input Button form Property
- HTML DOM Input FileUpload form Property
- HTML DOM Input Hidden form Property
- HTML DOM Input Month form Property
- HTML DOM Input Number form Property
- HTML DOM Input Radio form Property
- HTML DOM Input Range form property
- HTML DOM Input Reset form property
- HTML DOM Input Checkbox form Property

Advertisements