JSFiddle - React, Tailwind, and code Playground

by adeneo

HTML

<a href="#" abcjQuery12344353452343452345="12" id="first">First</a>




<br /><br />
<div id="result"></div>

JavaScript

var abcAttr, abcName;

$.each($("#first")[0].attributes, function(index, item) {
    if (item.nodeName.match(/^abc/)) {
        abcName = item.nodeName;
        abcAttr = item.nodeValue;
    }
});


$("#result").html('The attribute name is : '+abcName+'<br>And the Value is : '+abcAttr);