<select id="thresholdType" style="line-height:26px;border:1px solid #ccc" class="form-control"> <!-- <select id="thresholdType" name="thresholdType" class="form-control" value="清选择标签类型" style="line-height:26px;border:1px solid #ccc;width: 280px;" class="form-control"> --> <option value="" selected="selected">----请选择----</option> <option value="1">温度(°C) </option> <option value="2">湿度(%)</option> <option value="3">CO2浓度(ppm)</option> <option value="4">PM2.5浓度(ppm)</option> </select> 其中thresholdType 如何取到值
时间: 2023-07-19 20:42:26 浏览: 108
可以通过JavaScript代码获取到该select标签的值,具体代码如下:
```javascript
var thresholdType = document.getElementById("thresholdType").value;
```
这样就可以将thresholdType变量赋值为当前选中的选项的value值,即“1”、“2”、“3”或“4”。
阅读全文
相关推荐


















