im trying to use jquery in order to make a button remove its parent div.
my markup:
I recently was running into an issue with $.on() that unclear and very similar to this application, as most "remove this's parent" functions are.
To illustrate with this question's example:
$('.web_store_fields').on('click', '.button_remove_web_store', function(e){
$(this).parent().remove();
});
the big catch here is the second parameter. you must select the container $('.container')
and pass the element selector of the 'button' as the second parameter to the .on
function. so a definition(of sorts)
$('.container').on('click', '.myremovebutton', function(e){
$(this).parent().remove();
});