Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript window.innerWidth conditional statement

Tags:

javascript

I have a script which shows different content depending on the screen size, it looks like this:

if ((window.innerWidth < 1250 ))  {

//Do something

}

I am trying to set a greater than value as well as a less than value. I thought the follwoing would work:

if ((window.innerWidth < 1250 && > 750))  {

//Do something

}

Can anyone help me out?

like image 642
danyo Avatar asked Feb 26 '26 07:02

danyo


1 Answers

Close:

if (window.innerWidth < 1250 && window.innerWidth > 750)  {
like image 185
tymeJV Avatar answered Feb 28 '26 20:02

tymeJV