Window Resize in jQuery


Create a web page which has a function to calculate whenever the window gets resized. When the user resizes the webpage,the count will be increased automatically. Display the total number of times that the user resize the page.

Refer the Sample Webpage below

Window Resize in jQuery

Use 2 paragraph tags to display the output

  • First <p> tag with id “resize”
  • For Second <p> tag use id as ” test “

Include the JQuery Library –


<!DOCTYPE html>
        <script src=""></script>
        <script type="text/javascript">
                var x = 0;
                    $("span").text(x += 1);
        <p id="resize">
            Window resized
            <span>0</span> times.</p>
        <p id="test">Try resizing your browser window.</p>
  1. Customer Data
  2. Three Division
  3. Check Box Using JQuery
  4. Drag an Object
Sharing Is Caring

Leave a Comment