我正在尝试从下拉列表中获取当前文本:
function dtChange(){
var elem = document.getElementsByName("ul.dropdown-menu li a");
var name = elem.innerHTML;
但名称始终为“未定义”:
<div class="dropdown" name="dpt1">
<button class="btn btn-default dropdown-toggle" type="button" id="menu1" data-toggle="dropdown" data-target="#">ATT
<span class="caret"></span></button>
<ul class="dropdown-menu" id="company" role="menu" aria-labelledby="menu1">
怎么了?请帮忙。
答案 0 :(得分:0)
df[df == 0] <- NA
sapply(df, function(x)all(is.na(x)))
&#13;
或
function dtChange(){
var elem = document.getElementsByName(".dropdown-menu li a");
var name = elem.innerHTML;
&#13;
希望能帮到你