i have a dynamic add a href, on page refresh all the a href's added disappear. Is this normal or can i store it, to ensure the links added do not disappear.
$(document).on('click', 'li#order', function(){
$(this).before('<li><a href="Franchise-Rest-Details.php">HO</a></li>');
// add to localsorage?
window.onload = function(){
}
var order_open = $('div#Rest').html();
localStorage.setItem('div#Rest', order_open);
});
<!--Restaurant toggle -->
<a id="restt" class ="header"href="#" onclick="toggleVisibility('Rest');"><h3>Your Restaurants</h3></a>
<div id="Rest" style="display: none;"><div>
<ul class="tabs">
<li id="order" class="rred"><a class="sb" href="Franchise-account-orders.php">restaurant</a></li>
<li id="order" class="rgreen"><link class="sb">New restaurant</a></li>
</ul>
</div>
</div>
what is the best way to achieve this.
The a refs are successfully added but just do not stay when refreshed.