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

Quiz for Exam - 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>


Leave a Comment

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