WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Select Object


Select Object

The Select item speaks to a HTML <select> element.

Access a Select Object

You can get to a <select> component by utilizing getElementById():

var x = document.getElementById("mySelect"); Try it

Tip: You can likewise get to a Select item via seeking through the elements gathering of a form.

Create a Select Object

You can make a <select> component by utilizing the document.createElement() method:

var x = document.createElement("SELECT"); Try it

Select Object Collections

Collection Description
options Returns a gathering of the considerable number of choices in a drop-down list

Select Object Properties

Property Description
disabled Sets or returns whether the drop-down rundown is incapacitated, or not
form Returns a reference to the structure that contains the drop-down list
length Returns the quantity of <option> components in a drop-down list
multiple Sets or returns whether beyond what one alternative can be chosen from the drop-down list
name Sets or returns the estimation of the name property of a drop-down list
selectedIndex Sets or returns the file of the chose choice in a drop-down list
size Sets or returns the estimation of the measure of a drop-down list
type Returns which sort of structure component a drop-down rundown is
Sets or returns the estimation of the chose choice in a drop-down list

Select Object Methods

Method Description
< add() Adds an alternative to a drop-down list
remove() Removes an alternative from a drop-down list