I am generating an anchor tag through script with class 'section-delete-btn' :
<a class='section-delete-btn' role='button' id = '" + $("#section_name").val() + "'href='#'><i class='section-delete-btns fa fa-trash-o' aria-hidden='true'></i></a>
I am trying to access the a tag through class selector like this :
//delete a section
$('a').on('click','.section-delete-btn',function(){
//get section name
var section_name = $(this).attr('id');
alert(section_name);
});