当前位置: 移动技术网 > IT编程>开发语言>JavaScript > layui获取多选框中的值方法

layui获取多选框中的值方法

2018年08月18日  | 移动技术网IT编程  | 我要评论
html: <input type="checkbox" name="standard" value="<?=$key;?>"

html:

<input type="checkbox" name="standard" value="<?=$key;?>" <?=in_array($key, $standards) ? 'checked' : '';?> title="<?=$value;?>">

js:

$("input:checkbox[name='standard']:checked").each(function() { // 遍历name=standard的多选框
  standards += ',' + $(this).val();
  standardsname += ',' + $(this).attr('title');
});

以上这篇layui获取多选框中的值方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网