I have a problem, please help
So, I'm trying to create a code that will erase any input in the search bar when an image beside the search bar is pressed. HTML: <span id="search"> <img src="Icons/white-search.png"/> </span> <input type="text" name="search" placeholder="Search"> <span id="remove-text"> <img src="Icons/delete1.png"/> </span> Javascript: $(document).ready(function (){ var input = $('input').val(); $('#remove-text').on('click', function() { $('#remove-text').remove(input); }); }); As you can see, the above code is supposed to remove input data when the remove-text id (its an image) is pressed but it doesn't work. I tried asking it on StackOverflow but people there are not very friendly and apparently its wrong to ask a javascript question so they suspended me for 3 days. Any help is appreciated