3
To create a site, simple in javascript more would like to automate the selection elements, and a function to hide/show the elements. But I end up getting error. But I don’t understand why.
To select the elements I’m using
function $(par){
return document.querySelector(par)
}
and to hide:
function hide(e){
return e.style.display = 'none';
}
the declaration shall remain:
$('.header').hide()
only that I am returned the error:
Uncaught TypeError: $(...).hide is not a function
It seems that you are not calling jquery on your page. Of course, you should call before calling your js script.
– Gato de Schrödinger
Ah idea and redo these two functions of jquery in pure javascript
– Lukas Takahashi