Front End Technology Articles

Page 634 of 652

HTML DOM Input Checkbox required Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 431 Views

The Input Checkbox required property determines whether Input Checkbox is compulsory to check or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputCheckboxObject.requiredSetting required to booleanValueinputCheckboxObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that it is compulsory to check the checkbox to submit form.falseIt is the default value and checking is not compulsory.ExampleLet us see an example of Input Checkbox required property − Live Demo Required Attribute of Checkbox Check me ! I am required: Check if form is submittable    function getRequiredStatus(){       var requiredBool ...

Read More

HTML DOM Input Color autofocus Property

Kumar Varma
Kumar Varma
Updated on 30-Jul-2019 154 Views

The HTML DOM Input Color autofocus property sets/returns whether Input Color is focused upon initial page load.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputColorObject.autofocusSetting autofocus to booleanValueinputColorObject.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 Color autofocus property − Live Demo Input Color Autofocus Color Picker: Remove Auto Focus    var divDisplay = document.getElementById("divDisplay");    var inputColor = document.getElementById("Color");    divDisplay.textContent = 'Autofocus: '+inputColor.autofocus function removeAutoFocus() {   ...

Read More

HTML DOM Input Color defaultValue Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 192 Views

The HTML DOM Input Color defaultValue property sets/returns the default value corresponding to a color. It may or may not be same as value attribute.SyntaxFollowing is the syntax −Returning string valueinputColorObject.defaultValueSetting defaultValue to stringinputColorObject.defaultValue = ‘string’Boolean ValueHere, “string” can be the following −booleanValueDetails#000000 - #ffffffIt defines that input color can have a default value between the defined rangeExampleLet us see an example of Input Color defaultValue property − Live Demo Input Color Default Value Color Picker: Get Default Value    var divDisplay = document.getElementById("divDisplay");    var inputColor = document.getElementById("Color");    function getDefaultValue() { ...

Read More

HTML DOM Input Color form Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 140 Views

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

Read More

HTML DOM Input Color name Property

Kumar Varma
Kumar Varma
Updated on 30-Jul-2019 150 Views

The Input Color name property returns a string, which is the value of the input color name attribute. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputColorObject.nameSetting name attribute to a string valueinputColorObject.name = ‘String’ExampleLet us see an example of Input Color name property − Live Demo Input Color Name Color Picker: Change name value    var inputColor = document.getElementById("Color");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Name of color input: '+inputColor.name;    function changeNameValue() {       if(inputColor.name == 'primaryColor'){          inputColor.name ...

Read More

HTML DOM Input Color Object

Rama Giri
Rama Giri
Updated on 30-Jul-2019 197 Views

The HTML DOM Input Color Object represents an input HTML element with type color.SyntaxFollowing is the syntax −Creating an with type color −var colorObject = document.createElement(“input”); colorObject.type = “color”;AttributesHere, “colorObject” can have the following attributes −AttributesDescriptionautocompleteIt defines the value of autocomplete attribute of a color pickerautofocusIt defines if the color picker should be focused on initial page load.defaultValueIt sets/returns the default value of color pickerdisabledIt defines if color picker is disabled/enabledformIt returns a reference of enclosing form that contains the color pickernameIt defines the value of name attribute of a color pickertypeIt returns the type of form element of ...

Read More

HTML DOM Input Color type Property

Kumar Varma
Kumar Varma
Updated on 30-Jul-2019 192 Views

The HTML DOM Input Color type property returns/sets type of Input Color.SyntaxFollowing is the syntax −Returning string valueinputColorObject.typeSetting type to string valueinputColorObject.type = stringValueString ValuesHere, “stringValue” can be the following −stringValueDetailsColorIt defines that input type is colorRadioIt defines that input type is radioTextIt defines that input type is textExampleLet us see an example of Input Color type property − Live Demo Input Color Type Color Picker: Get type & change to text    var inputColor = document.getElementById("Color");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'Type of Input: '+inputColor.type;    function changeNameValue() { ...

Read More

HTML DOM Input Color value Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 147 Views

The HTML DOM Input Color value property returns a string, which represents the value of the input color value attribute. User can also set it to a new string.SyntaxFollowing is the syntax −Returning string valueinputColorObject.valueSetting value attribute to a string valueinputColorObject.value = ‘String’ExampleLet us see an example of Input Color value property − Live Demo Input Color Value Primary-Color: Get type & change to text    var inputColor = document.getElementById("Color");    var divDisplay = document.getElementById("divDisplay");    divDisplay.textContent = 'value: '+inputColor.value;    function changeValue() {       if(inputColor.value == '#00ff00'){       ...

Read More

HTML DOM Input Date autofocus Property

Kumar Varma
Kumar Varma
Updated on 30-Jul-2019 196 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

HTML DOM Input Date disabled Property

Rama Giri
Rama Giri
Updated on 30-Jul-2019 178 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
Showing 6331–6340 of 6,517 articles
« Prev 1 632 633 634 635 636 652 Next »
Advertisements