In IntelliJ, if I use a jQuery selector such as:
$('#roleField option').each(function() {
// impl omitted
});
The selector is highlighted with a suggestion that I should
split descendant selectors which are prefaced with ID selector
what exactly is IntelliJ suggesting that I should replace the selector above with?
$('#roleField').find('option')
$('#roleField').find('option').each()
.find
unless it's on an assigned variable. If I have aselector
, like you show above, I just do exactly what you're doing,$('#id child')
. There's really no reason to replace it with$('#id').find('child')
getElementById()
to fetch first record...