https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
The Document method
querySelector()returns the firstElementwithin the document that matches the specified selector, or group of selectors. If no matches are found, null is returned.
https://www.w3schools.com/cssref/css_selectors.asp
CSS selector works in the same way in JavaScript:
| Selector | Example | Example description |
|---|---|---|
[attribute=value] |
[target=_blank] |
Selects all elements with target="_blank" |
https://www.w3schools.com/jsref/met_audio_play.asp
var vid = document.getElementById("myVideo");
vid.currentTime = 5;The currentTime property sets or returns the current position (in seconds) of the audio/video playback.
https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
The
Element.classListis a read-only property that returns a liveDOMTokenListcollection of the class attributes of the element. This can then be used to manipulate the class list.
Using
classListis a convenient alternative to accessing an element's list of classes as a space-delimited string viaelement.className.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitionend_event
The
transitionenevent is fired when a CSS transition has completed. In the case where a transition is removed before completion, such as if thetransition-propertyis removed ordisplayis set to none, then the event will not be generated.