I have a pretty basic code:
if(screen.width > 600) {
document.querySelector('.toggle-sidenav').click();
}
As soon as the screen is > 600px I want to click that div that has a class of toggle-sidenav but the .click() method in Javascript is not working.
I don't want to use jQuery.
How can I achieve this?