我的代码如下:
var employee = {};
employee["fullname"] = document.userForm.fullname.value;
employee["license"] = document.userForm.license.value;
employee["address"] = document.userForm.address.value;
employee["dob"] = document.userForm.dob.value;
employee["city"] = document.userForm.city.value;
employee["state"] = document.userForm.state.value;
employee["zip"] = document.userForm.zip.value;
employee["sex"] = document.userForm.sex.value;
sessionStorage.setItem("session", JSON.stringify({"employees": [employee]}));
以这种方式存储是否正确?此外,如果这是正确的,我如何使用检索信息getItem
?