javascript - Jquery, how to select an element by its first position value of an attribute -
in html:
<tr data-s=""></tr> <tr data-s="1"></tr> <tr data-s="2 1"></tr> <tr data-s="3 2 1"></tr>
i'm trying build selector in order trs value of first position of data-s attribute.
thanks in advance.
you can element first position of data-s attribute far understood.
$('[data-s^="3 "]');
or if want first position of data-s attribute's value, can this;
$('[data-s]').data('s').split(' ')[0];
there a plunker example you.
Comments
Post a Comment