thanks for everyone who heloed me today already. i was told to use a storage to share the info and… well it didnt work.
I need to share the list that user made from list.js to dragANDdrop.js. from dragANDdrop.js i want to show this on html. well the list is not showing, i can’t get why so
here is what i tried
list.js
localStorage.setItem('lst', list);
dragANDdrop.js
list = localStorage.getItem('lst');
const html = list.map((item) => `<li>${item}</li>`).join('');
document.querySelector('ul').innerHTML = html;
the second part should display the list on the html page.
dragANDdrop.html
<section class="home-section">
<div class="home-content">
<i class='bx bx-menu' ></i>
<span class="text"><h1>To do list</h1></span>
<ul></ul>
</div>
</section>
<script src="list.js"></script>
<script src="dragANDdrop.js"></script>