JSFiddle - React, Tailwind, and code Playground

HTML

<a href='#'>blabla</a>
<br>
<a href='#' data-id='2'>blabla</a>

CSS

a {
    color: black
}

JavaScript

$(function() {
    $(this).filter(function() {
        return $(this).data(k) == v;
    });
    $.fn.datafilter = function(k, v) {
        return $(this).filter(function() {
            return $(this).data(k) == v;
        });
    };

    $('a').datafilter('id', 2);

})