Front End Technology Articles - Page 558 of 860

HTML DOM Input Datetime value Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

175 Views

The HTML DOM Input Datetime value property returns a string, which is the value of the value attribute of input datetime. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputDatetimeObject.valueSetting value attribute to a string valueinputDatetimeObject.value = ‘String’ExampleLet us see an example of Input Datetime value property − Live Demo Input Datetime Value Date & Time: Change Value    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = 'Current value: '+ inputDatetime.value;    function changeValue(){       var currDatetime = inputDatetime.value; ... Read More

HTML DOM Input Datetime type Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

450 Views

The HTML DOM Input Datetime type property returns/sets type of Input Datetime.SyntaxFollowing is the syntax −Returning string valueinputDatetimeObject.typeSetting type to string valueinputDatetimeObject.type = stringValueString ValuesHere, “stringValue” can be the following −stringValueDetailsdateIt defines that input type is datedatetimeIt defines that input type is datetimecheckboxIt defines that input type is checkboxtextIt defines that input type is textExampleLet us see an example of Input Datetime type property − Live Demo Input Datetime type Date of Birth: Get Time and Date    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = ... Read More

HTML DOM Input Datetime required Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

134 Views

The HTML DOM Input Datetime required property determines whether Input Datetime is compulsory to set or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.requiredSetting required to booleanValueinputDatetimeObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that it is compulsory to set the datetime field to submit form.falseIt is the default value and to set datetime field is not compulsory.ExampleLet us see an example of Input Datetime required property − Live Demo Input Datetime required Final Exam Datetime: Confirm Datetime    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect"); ... Read More

HTML DOM Input Datetime readOnly Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

94 Views

The HTML DOM Input Datetime readOnly property sets/returns whether Input Datetime can be modified or not.Following is the syntax −Returning boolean value - true/falseinputDatetimeObject.readOnlySetting readOnly to booleanValueinputDatetimeObject.readOnly = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetime is readOnly.falseIt defines that the input datetime is not readOnly and can be modified.Let us see an example of Input Datetime readOnly property − Live Demo Input Datetime readOnly Final Exam Datetime: Confirm Datetime    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = 'Exam Datetime Finalized: '+inputDatetime.readOnly; ... Read More

HTML DOM Input Datetime Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

221 Views

The HTML DOM Input Datetime Object represents an input HTML element with type datetime. Also, major browsers, except safari take type datetime as text only.SyntaxFollowing is the syntax −Creating an with type datetimevar datetimeObject = document.createElement(“input”); datetimeObject.type = “datetime”;AttributesHere, “datetimeObject” can have the following attributes −AttributesDescriptionautocompleteIt defines the value of autocomplete attribute of a datetime fieldautofocusIt defines if the datetime field should be focused on initial page load.defaultValueIt sets/returns the default value of datetime fielddisabledIt defines if datetime field is disabled/enabledformIt returns/sets the value of max attribute of datetime fieldminIt returns/sets the value of min attribute of datetime fieldnameIt ... Read More

HTML DOM Input Datetime name Property

AmitDiwan
Updated on 15-Jun-2020 12:15:23

120 Views

The HTML DOM Input Datetime name property returns a string, which is the value of the name attribute of input datetime. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputDatetimeObject.nameSetting name attribute to a string valueinputDatetimeObject.name = ‘String’ExampleLet us see an example of Input Datetime name property − Live Demo Input Datetime Name Datetime: Change name value    var inputDatetime = document.getElementById("datetime");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Name of datetime input: '+inputDatetime.name;    function changeNameValue() {       if(inputDatetime.name == "Mother's Birth ... Read More

HTML DOM Input Datetime min Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

153 Views

The HTML DOM Input Datetime min property returns/sets min attribute of Input Datetime.SyntaxFollowing is the syntax −Returning string valueinputDatetimeObject.minSet min to string valueinputDatetimeObject.min = YYYY-MM-DDThh:mm:ssTZDString ValuesHere, “YYYY-MM-DDThh:mm:ssTZD” can be the following −stringValueDetailsYYYYIt defines year (eg:1998)MMIt defines month (eg: 05 for May)DDIt defines Day (eg: 24)TIt is a separator for date and timehhIt defines hour (eg:12)mmIt defines minutes (eg:48)ssIt defines seconds (eg:00)TZDTime Zone Designator (IST denotes Indian Standard Time)ExampleLet us see an example of Input Datetime min property − Live Demo Input Datetime Min Date & Time: Decrease min age bar    var ... Read More

HTML DOM Input Datetime max Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

175 Views

The HTML DOM Input Datetime max property returns/sets max attribute of Input Datetime.SyntaxFollowing is the syntax −Returning string valueinputDatetimeObject.maxSetting max to string valueinputDatetimeObject.max = YYYY-MM-DDThh:mm:ssTZDString ValuesHere, “YYYY-MM-DDThh:mm:ssTZD” can be the following −stringValueDetailsYYYYIt defines year (eg:1998)MMIt defines month (eg: 05 for May)DDIt defines Day (eg: 24)TIt is a separator for date and timehhIt defines hour (eg:12)mmIt defines minutes (eg:48)ssIt defines seconds (eg:00)TZDTime Zone Designator (IST denotes Indian Standard Time)ExampleLet us see an example of Input Datetime max property − Live Demo Input Datetime Max Date & Time: Renew Insurance    var inputDate = document.getElementById("dateTime"); ... Read More

HTML DOM Input Datetime form Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

147 Views

The HTML DOM Input Datetime form property returns the reference of enclosing form for input datetime.SyntaxFollowing is the syntax −Returning reference to the form objectinputDatetimeObject.formExampleLet us see an example of Input Datetime form property − Live Demo Input Datetime form Date & Time: Get Form ID    function getFormID() {       var inputDatetime = document.getElementById("Datetime");       var divDisplay = document.getElementById("divDisplay");       divDisplay.textContent = 'Form ID for datetime input: '+inputDatetime.form.id;    } OutputThis will produce the following output −Before clicking ‘Get Form ID’ button −After checking ‘Get Form ID’ button −

HTML DOM Input Datetime disabled Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

172 Views

The HTML DOM Input Datetime disabled property sets/returns whether Input Datetime is enabled or disabled.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.disabledSetting disabled to booleanValueinputDatetimeObject.disabled = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetime is disabled.falseIt defines that the input datetime is not disabled and it is also the default value.ExampleLet us see an example of Input Datetime disabled property − Live Demo Input Datetime Disabled Date & Time: Enable Datetime Input    var divDisplay = document.getElementById("divDisplay");    var inputDatetime = document.getElementById("datetimeSelect");    divDisplay.textContent = 'Datetime Input ... Read More

Advertisements