Home  >  Article  >  Web Front-end  >  javascript code to get select drop-down list value_form effects

javascript code to get select drop-down list value_form effects

WBOY
WBOYOriginal
2016-05-16 18:47:161436browse

For example, when using DWR, if you want to pass the parameters of the drop-down box to the background, you need to obtain the value of the drop-down box first.
In fact, it is very simple to get the value of the drop-down box.
The most critical piece of code is:

Copy code The code is as follows:

onchange= "show(this.options[this.options.selectedIndex].value);"

onchange="show(this.options[this.options.selectedIndex].value);"
show is a custom function name.

this.options[this.options.selectedIndex].value is the protagonist!
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