PrepAway - Latest Free Exam Questions & Answers

Which CSS selector should you use?

You are implementing an application by using HTML5 and JavaScript. A web page contains
the following HTML table.

The application must:
Identify all rows in the table body that have a class attribute of selected
Exclude the last selected row in the table
You need to implement the web page according to the requirements.
Which CSS selector should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
tr:not(tr:last-child).selected < #dataTable

B.
#dataTable > tr.selected:not(tr:last-child)

C.
#dataTable tbody tr.selected:not(tr:last-child)

D.
#dataTable tr.selected:not(tr:last-child)

4 Comments on “Which CSS selector should you use?

  1. banshee says:

    What is this question exactly about? They’re asking to exclude last .selected row in tbody or last .selected row in table? If it’s the first option, then answer C is correct. But if it’s the second – then D is correct.




    0



    0
  2. brkyctn says:

    Explanation/Reference:
    * [attribute]
    [target]
    Selects all elements with a target attribute
    * :not(selector)
    not(p)
    Selects every element that is not a element
    Reference: CSS Selector Reference




    0



    0

Leave a Reply