DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Sushil Shrestha
Sushil Shrestha

Posted on

Answer: Using jQuery .append should add new li with the value from input field, but it only add empty li

Your code let currentItem = $('#newItem').val(); Doesn't works because it is outside button click event. So execute let currentItem = $('#newItem').val();only after the button is clicked. I would like to suggest to bind and unbind the event while using click events. And also check the if the…

Top comments (0)

Head to your account's Settings to...

🌚 Enable dark mode
πŸ”  Change your default font
πŸ“š Adjust your experience level to see more relevant content