layui点击radio获取后面的值
插入代码
function queryGifts(){ $.ajax({
url:
"../Gift/getGiftListALL.do",async: false, type:
"POST", dataType:
"JSON", success: function(data){
$(
"#gifts").empty();for (var i = 0; i < data.length; i++) {var gifthtml = "<div class='giftin'>" gifthtml
+="<img src='../toupiao/"+data[i].giftImg +"' />" gifthtml
+="<input class='gcount' type='radio' name='giftId' value='"+data[i].giftID+"'/><span>"+data[i].giftVoteCount+"</span></div>" $(
"#gifts").append(gifthtml); }
}
})
}
点击时候 获取值 放到页面中
$("#gifts").on("click",".layui-form-radio",function() {var giftNum=$(this).next().text(); $(
"#giftNum").val(giftNum) console.log(giftNum)
})
以上是 layui点击radio获取后面的值 的全部内容, 来源链接: utcz.com/z/508714.html