hasAttr() equivalent with jquery
Unfortunately, the .hasAttr() function is not available in jquery. However, different solutions can be found.
I share with you a solution I found below.
var attr = $(this).attr("name");
if (typeof(attr) === "undefined") {
/* .... */
} else {
/* .... */
}
That's it.
0 yorum:
Yorum Gönder