is it possible to use/print the same local storage element multiple times on the same page?document.getElementById("searchOutput").innerHTML=localStorage.searchTerms;
i tried to collect a search term and output it multiple times on the same page, but it only shows up the first place
<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>
You can only use a given id ONCE per web page.
To output something multiple times, you will either need to generate a unique id or use a class name on these elements. You can have multiple elements with a given class name.
By specification,
document.getElementById()only returns one object so you can never use it to retrieve multiple objects.