<script>
$(function(){
$("a.a, a.b, a.c, a.d").click(function () {
alert('Hi');
});
});
</script>
<a href="#" class="a button">Hi</a>
The above JQuery unfortunately doesn’t work. Probably an easy fix, any ideas? I need it to be a multi-selector, but with a’s that have multiple classes unfortunately don’t work.
You can also get there by registering it as a ‘live’ event that will match all future elements that fit the selector. Something like this:
That’ll cover you for any future elements created that also match your requirements.