Hi guys so i have just started learning php and was able to figure out how to do a search function from my database to get information. The only bit which does not work so far is that fact when i get that information, and the user clicks on Add it does not seem to work. So what i want to happen is like a shopping list. The user searchs through my database and finds the thing he wants. Then clicks Add. Below the search box anther box will appear with that word. So he knows it has been added. Then after this i can add a cross and they can click it and get rid of the item if they want. However i have tried solutions to this problem but cant seem to get anywhere. Any help in getting this problem to work would be great.
Code so far:
<input type="button" value="Add">
<div id="selectedStuff"></div>
</div>
$('#addButton').on('click', function( event ) {
var searchedValue = $('#search_term').val();
var divHolder = $('#selectedStuff');
divHolder.append(searchedValue + '<br>');
});
});