I have some elements such as:
<div class="button 17-facebook-dashboard-check">Elem1<div>
<div class="button 18-google-dashboard-check">Elem2<div>
<div class="button 19-twitter-dashboard-check">Elem3<div>
<div class="button">Elem4<div>
and a handler on:
$('.button').click(function () { });
Inside this handler I need to do some special operations such as extrapolate NN and SOCIAL for the elements that have a class that finishes with -dashboard-check
.
For example if I click on Elem4 nothing should happens. If I click on Elem1 I need to print 17 and facebook, both distinct in two variables.
What the fast way to do this on jquery? regex? .HasClass that endswith?