HTML Articles

Page 107 of 151

HTML DOM Select remove() Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 169 Views

The HTML DOM Select remove() method removes an option from a dropdown list (select element) in an HTML document. This method is useful for dynamically managing dropdown options based on user interactions or application logic. Syntax Following is the syntax for the Select remove() method − selectObject.remove(index) Parameters The method accepts the following parameter − index − A number representing the index position of the option to be removed. The index starts from 0 for the first option. Return Value This method does not return any value. It ...

Read More

HTML DOM Option index Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 184 Views

The HTML DOM Option index property returns or sets the index position of an option element within a dropdown list. The index is zero-based, meaning the first option has an index of 0, the second option has an index of 1, and so on. Syntax Following is the syntax for returning the index of an option − optionObject.index Following is the syntax for setting the index of an option − optionObject.index = number Return Value The index property returns a number representing the zero-based index position of the ...

Read More

HTML DOM Quote Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 202 Views

The HTML DOM Quote Object represents the element of an HTML document. The Quote object is used to create and manipulate inline quotations programmatically through JavaScript. It provides access to properties specific to the quote element, such as the cite attribute for referencing the source of the quote. Syntax Following is the syntax to create a Quote object using JavaScript − document.createElement("Q"); To access an existing Quote element by ID − document.getElementById("quoteId"); Properties The Quote object inherits all standard HTML element properties and methods. The specific property for ...

Read More

HTML DOM Option defaultSelected Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 148 Views

The HTML DOM Option defaultSelected property returns a boolean value indicating whether an option element was selected by default when the page loaded. This property reflects the presence of the selected attribute in the HTML markup, not the current selection state. Syntax Following is the syntax for the defaultSelected property − optionObject.defaultSelected Return Value The defaultSelected property returns − true if the option was selected by default (has the selected attribute) false if the option was not selected by default Basic Example Following example demonstrates the defaultSelected property ...

Read More

HTML DOM Option label Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 164 Views

The DOM option label property is used to get or set the value of the label attribute of an element in HTML. The label attribute provides a shorter alternative text for the option, which can be displayed in the dropdown instead of the option's content. Syntax Following is the syntax to return the label value − object.label Following is the syntax to modify the label value − object.label = "text" Return Value The property returns a string representing the value of the label attribute. If no label attribute ...

Read More

HTML DOM Option value Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 207 Views

The HTML DOM option value property allows you to get or set the value of an element within a dropdown. This value is what gets sent to the server when the form is submitted, which may differ from the visible text displayed to the user. Syntax Following is the syntax for returning the value − optionObject.value Following is the syntax for setting the value − optionObject.value = "newValue" Parameters newValue − A string that specifies the new value for the option element. Return Value ...

Read More

HTML DOM Input Date type Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 175 Views

The HTML DOM Input Date type Property returns or sets the type attribute of an input element with date type. This property allows you to dynamically change the input type from a date picker to other input types like text, radio, or checkbox using JavaScript. Syntax Following is the syntax for returning the type property − inputDateObject.type Following is the syntax for setting the type property − inputDateObject.type = stringValue Parameters The stringValue parameter can be any valid HTML input type. Common values include − ...

Read More

HTML DOM Input Date value Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 172 Views

The HTML DOM Input Date value property allows you to get or set the value of an element. The value is returned as a string in YYYY-MM-DD format, which is the ISO 8601 date format standard. Syntax Following is the syntax to get the value − inputDateObject.value Following is the syntax to set the value − inputDateObject.value = 'YYYY-MM-DD' Return Value The value property returns a string representing the selected date in YYYY-MM-DD format. If no date is selected, it returns an empty string. Getting the Date ...

Read More

HTML DOM Input Datetime autofocus Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 189 Views

The HTML DOM Input Datetime autofocus property sets or returns whether a datetime input field should automatically receive focus when the page loads. This property corresponds to the autofocus attribute in HTML. Syntax Following is the syntax for getting the autofocus property value − inputDatetimeObject.autofocus Following is the syntax for setting the autofocus property − inputDatetimeObject.autofocus = booleanValue Return Value The property returns a boolean value indicating whether the datetime input has autofocus enabled − Value Description true The input field ...

Read More

HTML DOM Input Datetime disabled Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 214 Views

The HTML DOM Input Datetime disabled property sets or returns whether an Input Datetime field is enabled or disabled. When set to true, the input field becomes non-interactive and appears grayed out, preventing user input. Syntax Following is the syntax for returning the disabled status − inputDatetimeObject.disabled Following is the syntax for setting the disabled property − inputDatetimeObject.disabled = booleanValue Parameters The booleanValue parameter accepts the following values − Value Description true Disables the input datetime field, making it non-interactive and ...

Read More
Showing 1061–1070 of 1,509 articles
« Prev 1 105 106 107 108 109 151 Next »
Advertisements