Home > Web Front-end > JS Tutorial > How to get the value of the select drop-down box (option has no and value attributes)_javascript skills

How to get the value of the select drop-down box (option has no and value attributes)_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:16:33
Original
1335 people have browsed it

How to get the value of the select drop-down box:
1. When the option of the drop-down box has no value attribute

Copy the code The code is as follows:






<script> <br>window.onload = funciton(){ <br>var param = document.getElementById("param1"); <br>param.onchange = getParam(){ <br>var selectIndex = param.selectIndex; //Get the index number of the option <br>var text = param.options[selectIndex].text; <br></script>
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