$('[role="button"]').click(function () {
myMethod();
});
I know that on click on something it calls myMethod(), but on click on what?
What does role mean?
Is this button?
<input type="button" ... />
What is: [role="button"] ?
It is an attribute equals selector.
$('[role="button"]')would select all elements that has attributeroleset tobutton.For ex:
All below three will be selected when you do
$('[role="button"]')But this will not