具体行为是前端html页面发送请求到controller
1.后台发送的数据 是spring框架中的东西model.addObject(“student”,stu);
前台页面由隐藏的接收东西
页面代码:
<input id="wfsi" class="hidden" th:value="${student.age}"/> <div> <input id="ckbx" type="checkbox"/> </div>1
2
3
4
5
jq代码设置checkbox的几种方法:
1.attr //设置复选框为勾选状态 $("#ckbx").attr("checked","checked"); //设置复选框未选中状态 $("#ckbx").removeAttr("checked"); 2.prop //设置复选框为勾选状态 $("#ckbx").prop("checked",true);1
2
3
4
5
6
7
8
9
10
11
以上是在jq.1.12.4.js和bootstrap环境下运行,具体行为是前端html页面发送请求到controller,springBoot自动获取对应的数据进行措置惩罚惩罚,将返回的功效东西(Model以及addObject要领)传回给html,,然后jq获取卖力接收数据的input标签的值。
食火的埃尔德里奇
颁布了46 篇原创文章 · 获赞 8 · 访谒量 7万+
私信 存眷
原文链接 https://blog.csdn.net/qq_26917447/article/details/78801392
1.开启disabled,是input不成以编纂
$("#id").attr("disabled","disabled");
2.封锁disabled
$("#id").removeAttr("disabled");
普通js中是这样写的,document.getElementById("id").disabled = false;
错误写法:$("#id").attr("disabled","false");
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31355.html