This is a simple and practical web effects get Select value Oh, we use getElementById to get select ID=CC, and then we use option to index the value of the current option Oh
<!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd "" <html xmlns= "http://www.w3.org/1999/xhtml" <head> <meta http-equiv= "Content-type" content= "HTML; charset=gb2312 "/> <title>js Gets the value of the Select Drop-down box </title> <script language=" Web Effects " function GetValue () { var t = document.getElementById ("cc"); alert (t.options[t.selectedindex].value); }
function addselect () { var selectvar = docuemnt.all (' Select1 '); var options = selectvar.options; var index = Selectvar.selectedindex; var selectvalue = Options[index]; options[i] = new option ("added value", "values"); } </script> </head>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.