标签:div doc 循环 ++ htm elements symbol 容器 des
bootstrap:
<!--列表容器-->
<div class="panel-body" style="position:relative;">
<form id="searchForm">
</form>
</div>
1 var html = ""; 2 for (var m = 1; m < Math.ceil(dataList.length/3)+1; m++) { 3 html += ‘<div class="row form-inline form-group" >‘; 4 for (var n = 1; n < 4; n++) { 5 html += ‘<div class="col-lg-4 col-md-4 col-xs-4 col-sm-4">‘; 6 html += ‘<select class="form-control" style="width: 30%;text-align: center;background-color: #6495ED" onchange="changeSelect()">‘; 7 html += ‘ <option value="">---请选择---</option>‘; 8 for (var i = 0; i < dataList.length; i++) { 9 html += ‘ <option value="‘ +dataList[i].value+ ‘">‘ +dataList[i].name+ ‘</option>‘; 10 } 11 html += ‘</select>‘; 12 html += ‘<span type="text" class="form-control" aria-describedby="basic-addon1" style="width: 30%;text-align: left"></span>‘; 13 html += ‘</div>‘; 14 } 15 html += ‘</div>‘; 16 } 17 $("#searchForm").html(html);
for (var k = 0; k < document.getElementsByTagName("select").length; k++){ if ( document.getElementsByTagName("select")[k].value == price.symbol){ document.getElementsByTagName("span")[k].innerHTML = price.Price; } }
标签:div doc 循环 ++ htm elements symbol 容器 des
原文地址:https://www.cnblogs.com/hpwd/p/11758742.html