In my code I use
$('button').hide();
To hide a button.
I do not want to include jQuery.
In the example below I try to define $
as a document.querySelector
function.
const $ = document.querySelector;
$('button').style.display = 'none';
I can't use $
when binding the function this way.
Can you explain the reason why this is the case.
Also can you explain how I would be able to bind $
to document.querySelector