checkbox获取多选框,创建本地存储
2017年11月17日
checkbox获取多选框,创建本地存储
//本地存储对象和数组都需要转JSON字符串JSON.stringify
var disease = [];
$('input[name="operation"]:checked').each(function(){
disease.push($(this).val());
});
localStorage.setItem('oper',JSON.stringify(disease));
关注公众号
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
jquery weui地区选择器数据自定义报错'sub' of undefined,修改源码解决
jquery weui地区选择器数据自定义报错'sub' of undefined,修改源码解决 报错原因是数据格式错误,或者设置默认选择的地区与数据不一致 <div class="weui-cell"> <div class="weui-cell__hd">居住地:</div> <div class="weui-cell__bd"> <input class="weui-input" type="text" id="city" value="北京 北京市 东城区"> </div> </div> city-picker.js +function($){ //部分地区数据,按照以下格式自定义数据,此处省略一万行 $.rawCitiesData = [{ "name": "北京", "code": "110000", "sub": [{ "name": "北京市", "code": "110000", "sub": [{ "name": "东城区", "code": "110101" }, { "name"...
-
下一篇
JavaScript test framework : Mocha
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on GitHub. https://mochajs.org/#reporters INSTALLATION Install with npm globally: $ npm install --global mocha or as a development dependency for your project: $ npm install --save-dev mocha Mocha currently requires Node.js v6....
相关文章
文章评论
共有0条评论来说两句吧...

微信收款码
支付宝收款码