I need two conditions to be true for my selector. I would like the listener to hear events for the below buttons. My current selector doesn’t work:
html:
<div class="myclass" data="mydata">
<button>1</button>
<button>2</button>
<button>3</button>
</div>
javascript(does not work):
$('body').on('click.myListener', '[data^=mydata] .myclass > button ', function (e) {})
Remove the space between the
attributeandclassselectors: