Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving data in div after page refresh

Tags:

html

jquery

I am creating a search bar where the user can select parameters which creates a chip in the search bar. This chip will be created dynamically for every selection in a div with the class name 'chips'. After submitting the selection, the page redirects based on the selection. As the chips were dynamically created, they will be deleted on page reload. My question: Is there a way to store this dynamic data without deleting it after the page refresh?

  <div class="chips" id="createdChips" >
         <span> class ='someclass' </span>
         <span> class ='someclass' </span>          
  </div>
like image 311
Sudheer Avatar asked Mar 06 '26 10:03

Sudheer


1 Answers

You can store your dynamically created data in cookies or session storage. When your page load, search if there's data stored in above storage and draw the chips based on data.

like image 102
Ashycre Avatar answered Mar 09 '26 00:03

Ashycre