this is what I what I have:
And now I want to make the live search. The point is when you type in the textbox you automatically have to search in the localstorage with something that equals the text in the search box. All the data that doesn't matches dissapears.
$("#searchbox").keyup(function(){ // Retrieve the input field text var searchtext = $(this).val(); // Loop through the local storage var a = {}; a = JSON.parse(localStorage.getItem('session')); alert(a); });
As you can see I make an alert and my output is this:
{"21114":{"id":"21114","external_id":"","sessiongroupid":"1844","eventid":"5588","order":"0","name":"localStorage HTML5 Session","description":"localstorage","starttime":"2013-04-23 12:00:00","endtime":"2013-04-23 13:30:00","speaker":"","location":"","mapid":"0","xpos":"0.000000","ypos":"0.000000","maptype":"plan","imageurl":"","presentation":"","organizer":"0","twitter":"","allowAddToFavorites":"0","allowAddToAgenda":"0","votes":"0","url":"","venueid":"0"},"21115":{"id":"21115","external_id":"","sessiongroupid":"1845","eventid":"5588","order":"0","name":"tweede","description":"tweede","starttime":"2013-04-03 00:00:00","endtime":"2013-04-04 00:00:00","speaker":"","location":"","mapid":"0","xpos":"0.000000","ypos":"0.000000","maptype":"plan","imageurl":"","presentation":"","organizer":"0","twitter":"","allowAddToFavorites":"0","allowAddToAgenda":"0","votes":"0","url":"","venueid":"0"}}
Now I want to search on the name. Can somebody help me how to do this?