There is html that is generated automatically and is given to me as it is:
<li class="test1" title="title1-gen"> <span class="inner-class"data="0">×</span>Select1 </li> I try to make it so that by clicking on Select1 , I have one function executed, and by clicking on × , the other is executed, respectively.
I tried the easiest option:
$('.test1[title="title1-gen"]').on('click', function() { $('.inner-class').on('click', function() { alert('NO'); return; }); alert('YES'); }); But clicking on the cross still shows YES . I tried to make $('.inner-class') separately, change the data and check it, but YES is still called. Is it even possible to crank like