Has Attribute Extension Method (jQuery)
A useful jQuery extension method for checking if an Html element has an attribute.
$.fn.hasAttr = function (name) {
var undefined;
return this.attr(name) !== undefined;
};
Usage is as follows:
$('#CompanyId').hasAttr('data-rank');