I have a problem with my JQuery, I don't understand why the remove button don't work, could you help me please ? =) So here is my code :
$('.removeBook').on('click', function() {
$('div').remove();
});
$('#createBook').click(function() {
$('#list').append('<div>Hello' + '<button type="button" name="removeBook" class="removeBook">Remove</button>' + '</div>');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<button type="button" name="createBook" id="createBook">Create</button>
<div id="list">
</div>
Thanks in advance if you can help me !