Why use document.querySelector () to select elements on jsbin and the result is null

Feb.28,2021

is used in the wrong way. Your output is output through the F12 browser developer tool, while JSbin has its own place to write JavaScript and console console .

is equivalent to the console console you are using for the entire page, not your content in the JSbin tool code

pay attention to the row on the left of your screenshot, HTML , CSS , JavaScript , Console , Output , these are combined.


clipboard.png


~


jsbin

clipboard.png

Menu