Wes Bos Flashcards
How do you specify a css variable and reference it?
\:root{ --base: #ffc600; --spacing: 10px; --blur: 10px; }
reference it example:
var(–spacing)
How would you select all inputs on a page using vanilla js
document.querySelectorAll(‘input’)
What is a data attribute?
An attribute that you’ve made up, can be made by simply writing data- and the attribute name
What is dataset?
dataset is a object of all the data attributes on the page
what is the target of the event
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