width() method | Get Width of the Browser Window in Jquery

Date Published: 10/05/2020 Published By: JaiSchool

The predefined width() method in Jquery lets you know the width of the browser window.

<!DOCTYPE html>
  <title>Jquery width()</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

   var width=$(window).width();
   alert("Width of the window is - "+width);


Publish A Comment

Leave a Reply

Your email address will not be published. Required fields are marked *