提交表单时,如何将值从表单保存到 sessionStorage?
像这样的东西?
<form id="myForm" method="get" action="lista.html" rel="external" data-ajax="false" >
<label for="autonumero"> Anna autonumero </label>
<input type='tel' name="autonumero" data-corners="false"/>
<input type="submit" onclick="saveData()" value="OK" data-theme="a" data-corners="false" />
<script> function savedata()
{ var input = document.getElementById("autonumero");
sessionStorage.setItem("autonumero", input.value);
</script>
</form>
表单也需要提交,因此仅保存值是不够的