 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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 Datetime form Property
The HTML DOM Input Datetime form property returns the reference of enclosing form for input datetime.
Syntax
Following is the syntax −
Returning reference to the form object
inputDatetimeObject.form
Example
Let us see an example of Input Datetime form property −
<!DOCTYPE html> <html> <head> <title>Input Datetime form</title> </head> <body> <form id="dateTimeForm"> Date & Time: <input type="datetime" id="Datetime" value="2009-12-19T12:48Z"> </form> <button onclick="getFormID()">Get Form ID</button> <div id="divDisplay"></div> <script>    function getFormID() {       var inputDatetime = document.getElementById("Datetime");       var divDisplay = document.getElementById("divDisplay");       divDisplay.textContent = 'Form ID for datetime input: '+inputDatetime.form.id;    } </script> </body> </html> Output
This will produce the following output −
Before clicking ‘Get Form ID’ button −

After checking ‘Get Form ID’ button −

Advertisements
 