Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将值从 index.html 传递到其他 html 文件。如何使用在其他页面的 index.html 中创建的值?
在 page1.html 中:
localStorage.setItem("myValue", myValue);
在 page2.html 中
var myValue = localStorage.getItem("myValue");