是否可以在同一页面上多次使用/打印相同的本地存储元素?document.getElementById("searchOutput").innerHTML=localStorage.searchTerms;
我试图收集一个搜索词并在同一页面上多次输出,但它只显示在第一位
<div class="outputText">
<ul><li>You have searched <span id="numberClicks">0</span> times.</li>
<li>You have searched for <span id="searchOutput"> nothing yet</span>.</li></ul>
</div>
<div class="scroogleSearch">
<h2>News results for <span id="searchOutput"> </span></h2>
<h2><span id="searchOutput"></span> on Twitter - @<span id="searchOutput"> </span></h2>
<h2><span id="searchOutput"> </span> - Wikipedia, the free encyclopedia</h2>
</div>