I create a button:
var removeButton = document.createElement('button');
$(removeButton).attr('class', 'removeProduct');
$(removeButton).append(document.createTextNode('X'));
$(removeButton).data('divId', 'productLine' + numProductsInCart);
This works, the button appears.
However, when I try to produce an alert on that button being clicked it doesn't work. I click the button and it doesn't do anything.
Here is what I have got to so far:
$('.removeProduct').click(function() {
alert("Hey");
});