Table of Content
Remove book entry
Next we will work on the book deletion.
We begin at the model. We add a removeBook
function. It is similar to the ticker removal from the TwentyFive timer.
When the delete button is clicked, we remove the book from the model data. Then render the list again to reflect the changes.
The click event of delete button. Since the book entry is created dynamically, normal click
event doesn’t work. We need the following jQuery delegate
method.
Note: The click
event equivalent.
And delegate
event is very similar to the bind
event:
1$(element).delegate(selector, 'click', handler);
What’s next? We’re going to take a look at “Taking the inputs data”.