layui框架下实现单选按钮监听


<label class="col-sm-2 control-label">类型:</label>
<div class="col-sm-4">
<label class="radio-box"><input type="radio" th:checked="@{(${user.type == 0}? 'true' : 'false')}" value="0" id="type1" name="type">用户</label>
<label class="radio-box" id="type2Label"><input type="radio" th:checked="@{(${user.type == 1}? 'true' : 'false')}" value="1" id="type2" name="type" >测试</label>
<label class="radio-box" id="type3Label"><input type="radio" th:checked="@{(${user.type == 2}? 'true' : 'false')}" value="2" id="type3" name="type">管理员</label>
</div>


$(function() {
$('input').on('ifChecked', function(event){
var menuType = $(event.target).val();
var isManageSubLabel = $("#isManageSubLabel");
var isManageSubDiv = $("#isManageSubDiv");
isManageSubLabel.hide();
isManageSubDiv.hide();
if (menuType == "1") {
isManageSubLabel.show();
isManageSubDiv.show();
}
});
});


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM