I have this snippet in jQuery. I append an input text when a user clicks on an add sign that has an id 'clickEventOnPlus'. Within this appened code, there is a minus sign (defined in within ) that has another class clickEventOnMinus.
$('#clickEventOnPlus').click(function(){
var addDestination2 = '<input type="text" <span><i style="font-size:18px" class="fa clickEventOnMinus"></i></span> <br> <br>'
$(".addDestination").append(addDestination2);
});
How do I add an event listener on clickEventOnMinus? Because when I try the following code, it doesn't work. Thanks!
$('.clickEventOnMinus').click(function(){
alert("W");
});