Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let sto = [localStorage.getItem("sticker")];
- pushResult();
- $("#textInput").change(function() {
- if ($(this).val() !== "") {
- sto.push($(this).val())
- localStorage.setItem("sticker",sto);
- pushResult();
- }
- });
- function pushResult() {
- $('#result').html('')
- $.each(sto, function(key, value) {
- $('#result').append(`<li key="${key}">${value}</li>`);
- document.getElementById("textInput").value = "";
- });
- };
Add Comment
Please, Sign In to add comment