Once you've made a selection, you typically want to know whether it actually found anything. Since selectors _always_ return an object (the set of selected DOM elements), the best way to see whether your selection found anything is to test the returned object's ``++.length++`` property.
\[~ann.campbell.2] Assigned for review and completion. The description is a copy/paste of \https://learn.jquery.com/using-jquery-core/selecting-elements/, I was afraid that if I started to rephrase it would not make any sens anymore.
=== on 27 Mar 2015, 15:24:13 Ann Campbell wrote:
double-check me, please [~linda.martin]
=== on 19 May 2015, 15:54:00 Linda Martin wrote:
Reviewed.
=== on 24 Apr 2017, 10:24:45 Elena Vilchik wrote:
\[~ann.campbell.2] why minor?
=== on 1 Nov 2019, 17:29:53 Elena Vilchik wrote:
See \https://github.com/SonarSource/SonarJS/issues/1698