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));
checkbox獲取多選框,創建本地存儲
//本地存儲對象和數組都需要轉JSON字符串JSON.stringify
var disease = [];
$('input[name="operation"]:checked').each(function(){
disease.push($(this).val());
});
localStorage.setItem('oper',JSON.stringify(disease));