Wes Bos Flashcards

1
Q

How do you specify a css variable and reference it?

A
\:root{
      --base: #ffc600;
      --spacing: 10px; 
      --blur: 10px; 
    }

reference it example:
var(–spacing)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you select all inputs on a page using vanilla js

A

document.querySelectorAll(‘input’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a data attribute?

A

An attribute that you’ve made up, can be made by simply writing data- and the attribute name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is dataset?

A

dataset is a object of all the data attributes on the page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the target of the event

A

it is the thing that the event got triggered on

target can sometimes be the children of the element you are trying to focus on. this is tricky so watch out

example mousemove on a container element will have a target equal to the container but if you mousemove on a child h1 or child div then the new target will switch to the child element

this keyword will point to the event listener

How well did you know this?
1
Not at all
2
3
4
5
Perfectly