mui?单选框?默认事件?

<div class="mui-input-row mui-radio mui-left moren">


<label>设为默认</label>

<input name="radio1" type="radio" checked class="moren">

</div>

我使用的mui的单选组件当他触发点击事件

$(document).on('click','.moren',function(){ $.post("http://1er/default_address",{userId:uid,id:$(this).attr('id')}, function (data) { })

})

触发点击事件后向后台发送一请求将这个设置为单选按钮,但是不管有多少个总是最后一个选中样式,大神指教改怎么改?

https://img1.mukewang.com/5c99da710001783801370800.jpg

慕码人2483693
浏览 1312回答 1
1回答

陪伴而非守候

是这个意思?<div id="content">&nbsp; <div class="mui-input-row mui-radio mui-left moren">&nbsp; &nbsp; <label>设为默认</label>&nbsp; &nbsp; <input name="radio1" type="radio" class="moren" id="r1">&nbsp; </div>&nbsp; <div class="mui-input-row mui-radio mui-left moren">&nbsp; &nbsp; <label>设为默认</label>&nbsp; &nbsp; <input name="radio1" type="radio" class="moren">&nbsp; </div>&nbsp; <div class="mui-input-row mui-radio mui-left moren">&nbsp; &nbsp; <label>设为默认</label>&nbsp; &nbsp; <input name="radio1" type="radio" class="moren">&nbsp; </div></div>// 选中最后一个&nbsp;document.querySelector(".moren:last-child .moren").checked = "true";
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript