In this coded which are the selectors. Please explain them.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ashutosh GuptaRank #805 · 2.9K reputationPosted Dec 4, 2019, 7:15 PM EST
Sanwar RanwaRank #23 · 44.7K reputationPosted Dec 4, 2019, 6:10 PM EST
"languages"
>"web"
>Ramachandran MRank #2,660 · 522 reputationPosted Dec 4, 2019, 6:28 PM EST
console.log($('#languages').children('li:first').text());
//Result Java
console.log($('#web').children('li:first').text());
//Result JavaScript
console.log($('#languages').children('li:last').text());
//Result List
});
Faisal PathanRank #291 · 8.6K reputationPosted Dec 4, 2019, 7:48 PM EST
Harsh ShahRank #1,322 · 1.3K reputationPosted Dec 10, 2019, 6:25 PM EST
Sandhiya PriyaRank #26 · 43.2K reputationPosted Jan 5, 2026, 10:45 PM EST
In your HTML, the main jQuery selectors are:
ID selectors ?
$("#languages"),$("#web")Class selector ?
$(".functional")Tag selector ?
$("li"),$("ul")Descendant/child selectors ?
$("#languages li"),$("#languages > li"),$("#web li")Positional selectors ?
$("#languages li:first"),$("#languages li:last"),$("#languages li:eq(1)")These let you target elements by id, class, tag, hierarchy, or position.