Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 17:34:12
Original
1173 people have browsed it

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









Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template