Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Perform: Traversing Elements with querySelector

input[type=checkbox]

How did he know this was the right way to identify the element?

He mentioned css3, is it on another course?

I thought I had css pretty well covered, but maybe not as well as I thought!

2 Answers

Cosmin Cioaclă
Cosmin Cioaclă
21,339 Points

There are two inputs in the list item. One is a text input and the other is checkbox.

The difference between the two is the value of the html attribute "type".

In CSS3 you can select something by its attribute like so:

[attr="something"]

In this case he chose to select the input that has an attribute of "type" with a value of "checkbox" to target what he needed.

If you need more info you can check the MDN docs here.

thanks!