<div class="codetitle"> <span><a style="CURSOR: pointer" data="85020" class="copybut" id="copybut85020" onclick="doCopy('code85020')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code85020"> <br>//設定快取,取得設定的緩存,鍵值對形式, name value <br>localStorage.getItem("key"); //取得鍵的值<br>localStorage.setItem("key", 1); //設定鍵的值<br> </div>