weui的下拉框的赋值与取值

weui相关问题

页面代码:

 

样式:

.dly_select{
    width:calc(80% - 0.5% );
    height:2rem;
    border:1px solid #1AAD19;
    margin:0.65rem auto;
    padding-left:10px;
    box-sizing:border-box;
    font-size:0.8rem;
    border-radius:5px;
    color:#666;
    line-height:2rem;
}

.dly_select{
    background: transparent;
    background: url(${pageContext.request.contextPath}/resources/hit/images/app/kscx/icon_xiala.png) no-repeat;
    background-position: 95% center;
    background-size:0.8rem 0.5rem;
    line-height:2rem;
    color:#666;
}

给下拉框赋值的方法:

 

//weui的身份类别下拉框赋值

$.ajax({
    url  : "${pageContext.request.contextPath}/fwdt/dengluye/listSflb",
    type : "GET",
    contentType : "application/json",
    success: function(result){
        result = JSON.parse(result).module;
//         console.log(result)
        var v_arry = [];
        var arryszqx = [];
        arryszqx.push(result[0].lbdm);
        $("#all_sflb").text(result[0].lbmc);
        $("#all_sflb").attr("data-action",result[0].lbdm);
        for(var i=0;i

取出weui下拉列表的值的方法:

//获取下拉列表中的身份类别的id

var lbdm = $("#all_sflb").attr("data-action");

 

页面:

weui的下拉框的赋值与取值_第1张图片 weui的下拉框的赋值与取值_第2张图片

大家如果有喜欢一起讨论技术或者思维方面问题的可以加我的微信 a1024271896 ,我是夏天,和大家一起探索未来的旅途。

 

你可能感兴趣的:(技术类文章)