I developed a jQuery function to search for all the necessary inputs in a specific section of a website.
function check_property_vars() {
jQuery(this).parents('.property_group').find('div[id^="property_group_"]:input[required]:visible').each( function() {
console.log('here');
});
}
The issue I'm facing is that my selector isn't functioning as expected. The code above should identify every property group and then target each visible, required input.
There are no errors displayed upon clicking, but I can move the console.log outside the selector and it works. It seems like the selector itself is the problem. The code appears to be correct since it doesn't cause any site disruptions; it simply fails silently.
https://jsfiddle.net/x0sh82uz/
I have created a demo on JSFiddle with sample code to provide a clearer view of how the properties are structured in the code, hoping that someone can pinpoint why my selector isn't working.