Found 2417 Articles for HTML

HTML DOM Input Date step Property

AmitDiwan
Updated on 13-Jun-2020 10:49:14

195 Views

The HTML DOM Input Date step property determines the legal day intervals to choose from when user opens the calendar. It sets or returns the input date step attribute value.SyntaxFollowing is the syntax −Returning number valueinputDateObject.stepSetting value attribute to a number valueinputDateObject.step = numberExampleLet us see an example of Input Date step property − Live Demo Input Date required Odd Days Calendar:    var divDisplay = document.getElementById("divDisplay");    var inputDate = document.getElementById("dateSelect");    divDisplay.textContent = 'Current step: '+inputDate.step; OutputThis will produce the following output. Here, step was set to 2 −

HTML DOM Input Date required Property

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

107 Views

The HTML DOM Input Date required property determines whether Input date is compulsory to set or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDateObject.requiredSetting required to booleanValueinputDateObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that it is compulsory to set the date field to submit form.falseIt is the default value and to set date field is not compulsory.ExampleLet us see an example of Input Date required property − Live Demo Input Date required Name:  Date of Birth:  Confirm    var divDisplay = document.getElementById("divDisplay");    var inputDate = document.getElementById("dateSelect");    function submit() {   ... Read More

HTML DOM Input Date readOnly Property

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

128 Views

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

HTML DOM Input Date Object

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

148 Views

The HTML DOM Input Date Object represents an input HTML element with type date.SyntaxFollowing is the syntax −Creating an with type datevar dateObject = document.createElement(“input”); dateObject.type = “date”;AttributesHere, “dateObject” can have the following attributes −AttributesDescriptionautocompleteIt defines the value of autocomplete attribute of a date fieldautofocusIt defines if the date field should be focused on initial page load.defaultValueIt sets/returns the default value of date fielddisabledIt defines if date field is disabled/enabledformIt returns a reference of enclosing form that contains the date fieldmaxIt returns/sets the value of max attribute of date fieldminIt returns/sets the value of min attribute of date fieldnameIt ... Read More

HTML DOM Input Date min Property

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

72 Views

The HTML DOM Input Date min property returns/sets min attribute of Input date type.SyntaxFollowing is the syntax −Returning string valueinputDateObject.minSetting min to string valueinputDateObject.min = YYYY-MM-DDString ValuesHere, “YYYY-MM-DD” can be the following −stringValueDetailsYYYYIt defines year (eg:1998)MMIt defines month (eg: 05 for May)DDIt defines Day (eg: 24)ExampleLet us see an example of Input Date min property − Live Demo Input Date Min Date Select:  Change Min Date    var inputDate = document.getElementById("date");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Min of date input: '+inputDate.min;    function getMinDate() {       var oldInputDate = inputDate.max;       inputDate.min = '1998-07-01';       divDisplay.textContent = 'Min of date input: ... Read More

HTML DOM Input Date max Property

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

93 Views

The HTML DOM Input Date max property returns/sets max attribute of Input date type.SyntaxFollowing is the syntax −Returning string valueinputDateObject.maxSetting max to string valueinputDateObject.max = YYYY-MM-DDString ValuesHere, “YYYY-MM-DD” can be the following −stringValueDetailsYYYYIt defines year (eg:1998)MMIt defines month (eg: 05 for May)DDIt defines Day (eg: 24)ExampleLet us see an example of Input Date max property − Live Demo Input Date Max Date Select: Change Max Date    var inputDate = document.getElementById("date");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Max of date input: '+inputDate.max;    function getMaxDate() {       var oldInputDate = inputDate.max; ... Read More

HTML DOM Input Date name Property

Rama Giri
Updated on 30-Jul-2019 22:30:26

68 Views

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

HTML DOM Input Date form Property

Kumar Varma
Updated on 30-Jul-2019 22:30:26

70 Views

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

HTML DOM Input Date disabled Property

Rama Giri
Updated on 30-Jul-2019 22:30:26

74 Views

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

HTML DOM Input Date autofocus Property

Kumar Varma
Updated on 30-Jul-2019 22:30:26

104 Views

The HTML DOM Input Date autofocus property sets/returns whether Input Date is focused upon initial page load.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDateObject.autofocusSetting autofocus to booleanValueinputDateObject.autofocus = booleanValueBoolean ValueHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that input will be autofocused on page load.falseIt is the default value and input is not autofocused.ExampleLet us see an example of Input Date autofocus property − Live Demo Input Date Autofocus Date Select: Remove Auto Focus    var divDisplay = document.getElementById("divDisplay");    var inputDate = document.getElementById("Date");    divDisplay.textContent = 'Autofocus: '+inputDate.autofocus function removeAutoFocus() {     ... Read More

Advertisements