How to get browser width using JavaScript code? October 16, 2022 by Tarik It’s a pain in the ass. I recommend skipping the nonsense and using jQuery, which lets you just do $(window).width().