how to change javascript variable based on display width w3 code example Example: get screen width javascript window.screen.width //or just screen.width