怎样获取mui里面我所选择的值?如我传的图片上的格式。
我写的js代码:
$("#dzq").empty();
$(cityList).each(function(){
var li='<ul class="mui-table-view mui-table-view-xradio ">'
+'<li class="mui-table-view-cell mui-ellipsis ">'
+'<a class="mui-navigate-right">'
+this
+'</a>'
+'</li>'
+'</ul>';
$("#dzq").append(li);
});
网页里的代码:
<div id="segmentedControlContents" class="mui-col-xs-7" >
<div class="mui-control-content mui-active" >
<div class="mui-control-content mui-active" id="dzq">
<ul class="mui-table-view mui-table-view-xradio" >
<li class="mui-table-view-cell">
<a class="mui-navigate-right" id="contentx1">
东城区
</a>
</li>
</div>
</div>
</div>
<script>
function juzhuShow(){
var elem=document.querySelector('.mui-table-view-radio .mui-selected');
var segmentedControlContents=document.getElementById("segmentedControlContents");
var muiControlContent=jQuery('.mui-control-content');
segmentedControlContents.style.height=window.innerHeight-44+"px";
//muiControlContent.get(0).style.height=window.innerHeight-44+"px";
muiControlContent.css('height',jQuery(window).height());
var editJuzhu=mui('#editJuzhu')[0];
mui('.jianli-juzhu')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal mui-active";
});
mui('.mui-scroll-wrapper').scroll();//设置滚动
mui('.juzhuOK')[0].addEventListener('tap',function(){
editJuzhu.className="mui-modal";
//mui('.juzhuNameCon')[0].innerHTML=mui('.mui-selected')[0].children[0].innerHTML;
});
jQuery('#segmentedControlContents li').on('click',function(){
jQuery('#segmentedControlContents li').removeClass('mui-selected');
jQuery(this).addClass('mui-selected');
})
}
</script>