Category : html

In the below html I have to change the ul li href value according to the selected country in window local storage value. <ul> <li><a href="#">USA</a></li> <li><a href="#">India</a></li> </ul> <ul> <li> <a onclick="window.localStorage.setItem(‘country’,JSON.stringify({‘country’:’USA’}))">USA</a> </li> <li> <a onclick="window.localStorage.setItem(‘country’,JSON.stringify({‘country’:’India’}))">India</a> </li> </ul> Source: Ask Javascript..

Read more