Guest User

Untitled

a guest
Feb 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. let data = [];
  2.  
  3. $("#textInput").change(function() {
  4. if ($(this).val() !== "") {
  5. data.push($(this).val())
  6. pushResult();
  7. }
  8. });
  9. let vali = [$("#textInput").val()]
  10. function pushResult() {
  11.  
  12. $('#result').html('')
  13. $.each(data, function(key, value) {
  14. $('#result').append(`<li key="${key}">${value}</li>`);
  15.  
  16. document.getElementById("textInput").value = "";
  17. });
  18.  
  19. };
Add Comment
Please, Sign In to add comment