Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
HTML Articles
Page 107 of 151
HTML DOM Select remove() Method
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 MoreHTML DOM Option index Property
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 MoreHTML DOM Quote Object
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 MoreHTML DOM Option defaultSelected Property
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 MoreHTML DOM Option label Property
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 MoreHTML DOM Option value Property
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 MoreHTML DOM Input Date type Property
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 MoreHTML DOM Input Date value Property
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 MoreHTML DOM Input Datetime autofocus Property
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 MoreHTML DOM Input Datetime disabled Property
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