I want to track clicks on a specific button that can be found on several pages. The corresponding jQuery selector is something like:
At the end of the string there is a number ## which differs across pages.
Can I use the jQuery onHandler extension and use a wildcard in the jQuery selector (something like button.btn....^) to track the clicks?
Solved! Go to Solution.
You can use CSS selectors to filter attributes, as described here: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
In your case, let us take the example class assigned to the button "button btn_12"
You could try using something like this which checks if it has the class "button" and has a class containing "btn_"
Hope that helps!