当input被选中时候获取改input的多个属性值

<input name="selectTicket" class="selectTic" data-property="${couponDetai.id }"  type="checkbox"  value="${vo.discount }" onclick="selectTicket();">

 

<script>

function selectTicket(){
$('.selectTic').each(function(i){
if($(this).is(":checked")){
var selectTicket = $(this).val();
var id = $(this).attr("data-property");
alert(selectTicket+"---"+id);
}else{

}
});
}

 


</script>

posted @ 2017-09-18 17:01  baby孔祥超  阅读(300)  评论(0编辑  收藏  举报