如何获取html下拉菜单中被选中的项的值(html怎么做多选下拉列表代码)

如何获取html下拉菜单中被选中的项的值(html怎么做多选下拉列表代码)

首页维修大全综合更新时间:2023-12-24 00:18:51

如何获取html下拉菜单中被选中的项的值

var obj = document.getElementById("DropDownListID")

;obj.options[obj.selectedIndex].value就是你所选择的值。该问题还有一种方法如下:

this.Label1.Text=DropDownList1.SelectedValue.ToString();}把DropDownList1的AutoPostBack的属性改为true。

大家还看了
也许喜欢
更多栏目

© 2021 3dmxku.com,All Rights Reserved.