In IntelliJ, if I use a jQuery selector such as:
$(\'#roleField option\').each(function() {
// impl omitted
});
The selector is highlighted
From the jquery documentation this method will not go through the Sizzle sector engine:
$('#roleField option').each(function() {
// No Sizzle
});
Where this one will:
$('#roleField').find('option') // Sizzle!
Look at the ID base selectors section here. Hence the second method will be faster than the first.
Try to use .find()
here:
$('#roleField').find('option').each(function() {
// impl omitted
});
Your warning seem like related to efficiency of the selector.
Related thread