JSFiddle - React, Tailwind, and code Playground
by Ali Soltani
HTML
<input id="mached" type="button" value="matched" />
<table>
<tr ng-repeat="std in students" ng-style="set_color(std)">
<td>A</td>
<td>a@test.com</td>
</tr>
<tr ng-repeat="std in students" ng-style="set_color(std)">
<td>B</td>
<td>b@test.com</td>
</tr>
<tr ng-repeat="std in students" ng-style="set_color(std)">
<td>C</td>
<td>c@test.com</td>
</tr>
</table>
CSS
.matched {
background-color: red;
}
JavaScript
$('#mached').click(function() {
matchRowByName();
});
function matchRowByName() {
$.each($('tr[ng-repeat="std in students"'), function() {
if ($(this).find('td').first().text() === "B") {
$('table').prepend($(this));
$(this).addClass('matched');
}
});
}