Q: Which of the following will select all elements within the class?
Solution: .class selects all elements within the given class, #id selects the element within the given id, element>element selects allelements where parent is
element, element selects allelements.
Q: Which of the following selects allelements and allelements?
A. element,elementB. element+elementC. element,elementD. element elementSolution: element,element selects allelements and allelements, element element selects all
elements inside
elements, element>element selects allelements where parent is a
element, element+element selects allelements that are placed immediately after
element.Q: Which of the following selects all elements with a target attribute?A. attributeB. attribute=valueC. attribute~=valueD. attribute^=valueSolution: attribute selects all elements with a target attribute, attribute=value selects all elements for the given target, attribute~=value selects all elements with a title attribute containing the given title, attribute=value selects all elements with a lang attribute value starting with the given lang.Q: Which of the following selects every element whose href attribute value contains the given substring?A. attribute$=valueB. attribute*=valueC. attribute^=valueD. attribute|=valueQ: Which of the following selects everyelement that has no children?
A. :emptyB. :enabledC. :checkedD. :disabledSolution: :empty selects everyelement that has no children including text nodes, :checked selects every checked element, :disabled selects every disabled element, :enabled selects every enabled element.
Q: Which of the following selects input element which has focus?A. :in-rangeB. :hoverC. :focusD. :invalidSolution: :focus selects input element which has focus, :hover selects links on mouse hover, :in-range selects input elements with a value within a specified range, :invalid selects all input elements with an invalid value.Q: Which selects all unvisited links?A. :last-childB. :not(selector)C. :linkD. :nth-child(n)Solution: link selects all unvisited links, :not(selector) selects every element that is the second child of its parent, :last-child selects everyelement that is the last child of its parent.
Q: Which of the following will select everyelement that is the only child of its parent?
A. :only-childB. :only-of-typeC. :optionalD. :out-of-rangeSolution: only-child selects everyelement that is the only child of its parent, :only-of-type selects every
element that is the only child of its parent, :optional selects input elements with no “required” attribute.
Q: Which selects document’s root element?A. :requiredB. :rootC. ::selectionD. :out-of-rangeSolution: root selects the document’s root element, ::selection selects the portion of an element that is selected by a user, :required selects input elements with “required” attribute specified, :out-of-range selects input elements with a value outside a specified range.Q: Which selects all visited links?A. :validB. :visitedC. :targetD. :selectionSolution: visited selects all visited links, :valid selects all input elements with a valid value, :target selects the current active # element, ::selection selects the portion of an element that is selected by a user.
You Have Score    /10