Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(".searchsome").on("click",function search(e) {
- addEntry();
- var entry = localStorage.getItem("allEntrie");
- for (var i = 0; i < entry.length; i++) {
- $(".showSearchData").append('<p class="keywordsOnDiv">' + entry[i] + '</p>');
- });
- function addEntry() {
- var existingEntries = JSON.parse(localStorage.getItem("allEntrie"));
- if(existingEntries == null) existingEntries = [];
- var entryTitle = $(".searchsome").val();
- localStorage.setItem("entrys", entryTitle);
- existingEntries.push(entryTitle);
- localStorage.setItem("allEntrie",existingEntries);
- };
- var entry = JSON.parse(localStorage.getItem("allEntrie"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement