I am looping through drop down option and checking attribute. if attribute match than counter is increase. At the end i show counter as alert. This is my code but some how its not working dont know why
var count= 0;
$('.mydropdown option').each(function () {
var level = this.attr("myattr");
if (level == "0") {
count++;
}
});
alert(count);
}