I have a function which, when the checkbox is checked, dynamically writes li to ol, which is empty.
the code:
$(":checkbox").click(function() {
var checkedState = $(this).is(':checked');
if (checkedState == true) {
var productName = $(this).attr("title");
$("#selectedProductsList").append("<li class=\"productList " + this + "\"><p class=\"removeIcon\"><img src=\"images/remove-icon.png\" alt=\"Remove Product\" /></p><span class=\"productName\">"+ productName +"</span></li>");
};
});
Then, when it is being recorded, a delete icon appears, which removes the element from ol when pressed. This removal icon has a removeIcon class, which can be seen in dynamic above.
I have a function that processes the remove call and then performs some actions: Code:
$('.removeIcon').click(function() {
alert("starting");
});
Right now I have a remove action just trying to alert the message that it triggered. But it does not seem to be part of the function.
- , li , .click? :
DOM $.click()
.live vs .click, .
?