Home >Web Front-end >JS Tutorial >JavaScript cascading drop-down list example code (self-written)_javascript skills

JavaScript cascading drop-down list example code (self-written)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:34:121200browse

Html dom refers to some dom operations supported by various browsers before the emergence of the w3c specification.
1, Select object.
Attributes
a, selectedIndex: the subscript of the option selected by the user, the subscript starts from 0
b, length: Get or set the number of options
c, options: return an array, array The element is Option object
2, Options object
attributes:
a, text: the text content of the option
b, value: the value of the option
c, selected: when the option is selected , the value is true, otherwise it is false
Tips: Create an Option object

Copy code The code is as follows:

var op=new Option(text,value);

A cascading drop-down list I wrote:
JavaScript cascading drop-down list example code (self-written)_javascript skills
The code is as follows:
Copy code The code is as follows:









Professional Choice









Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn