Input type datetime property name in Javascript
The Input type datetime property name used to set and retrieve the value of the name attribute of a datetime field, it used to determine unique name of the form element either on client or server side. It returns a string that represents the name of the datetime field.
Syntax
 1 <input>.name // to retrieve
 2 <input>.name = <string> // to set
input : A input type datetime element object to set and retrieve name property
string : It specifies the name of the input datetime element
Input type datetime property name
 1 <!DOCTYPE html>
 2 <html>
 3 <style>
 4   .container {
 5     margin: 20px 0;
 6   }
 7 </style>
 8 <body>
 9 	<h1>The Input Datetime Object</h1>
 10 	<h2>Example</h2>
 11 	
 12 	<div class="container">
 13 	  <form>
 14 	    <input id="datetime" type="datetime" name="regDateTime"/>
 15 	  </form>
 16 	</div>
 17 	
 18 	<button onclick="access()">Access</button>
 19 	<p id="result"></p>
 20 	<script>
 21 	function access() {	  
 22 	  const element = document.getElementById("datetime");
 23 	  const str = `The name of the datetime field is : <b>${element.name}</b>`;
 24 	  document.getElementById("result").innerHTML = str;	  
 25 	}
 26 	</script>
 27 </body>
 28 </html>
Input type datetime property name
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us