Jquery functions each and attr
2 answers
You warn the wrong thing. eachjust returns the / jQuery collection. You will need to warn inside each callback to alert the values of the custom attribute. Also. Please use the prefix data-when assigning [custom attributes] [1] to better meet standards.
$(".classname").each(function(){
alert($(this).attr("classname"));
});
+13