我需要在页面重新加载后保存复选框状态。我的查询字符串:页面重新加载后状态复选框
Mathes=1&Mathes=2&Mathes=3&Rols=2&Users=1&.......
我怎样才能得到这些数据?我写了一些代码:
$(document).ready(function() {
var value = window.location.href.match(/[?&]Matches=([^&#]+)/);
$('input[name=Mathes]').each(function (index) {
if (value[1] === $(this).val()) {
$(this).attr('checked', 'checked');
}
});
});
但是我只能得到第一个元素。我怎样才能通过所有参数得到它?