height() method | get Height of the Browser Window in Jquery

The Jquery’s height() method returns the height of the browser window.

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

<button>CHECK CURRENT HEIGHT WIDTH</button>

<script>
$(document).ready(function(){
   $("button").click(function(){
   var height=$(window).height();
   alert(height);
});
});
</script>

</body>
</html>

Leave a Comment