I currently have a variable that holds a list of selects, and my goal is to filter out only those with a 'dependsOn' attribute set to 'EventType'.
My initial attempt below doesn't seem to work as intended and returns a count of 0:
var selects = $("select");
var count = selects.find("[dependsOn='EventType']").length
alert(count);
I also tried the code snippet below which achieves the desired result, but I'm wondering if there's a simpler way to accomplish this?
var dependents = [];
selectLists.each(function() {
var dep = $(this).attr('dependsOn');
if (dep === undefined) return;
dependents.push(dep.val());
});