Interviewer And Interviewee Guide

Sizzle Selector Engine Interview Question:

Explain Positional Selector Additions?

Submitted by: Administrator
The word positional here refers to an element's placement in the set after a selection, based on document order. For instance, div:first would return an array containing the first div on the page and div:first em would initially get the first div on the page, then all of the em's within that div. This works by first doing a selection for divs, retrieving the first one from that set, then using that div as the context for finding all em's. Note that all positional selectors are zero-indexed (corresponding to array positions).

:first/:last: Finds the first or last matching element on the page.
:even/:odd: Finds every other element on the page (counting begins at 0, so :even would match the first element).
:eq/:nth: Finds the nth element on the page (e.g. :eq(5) finds the 6th element on the page).
:lt/:gt: Finds all elements at positions less than or greater than the specified positions
Submitted by: Administrator

Read Online Sizzle Selector Engine Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.