Open In App

JQuery | isWindow() Method

Last Updated : 30 Apr, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

This isWindow() Method in jQuery is used to determine whether the argument is a window.

Syntax:

jQuery.isWindow( obj )

Parameters: This method accept a single parameter which is mentioned above and described below:

  • obj: This parameter holds the object to test whether or not it is a window.

Return Value: It returns the boolean value.

Below examples illustrate the use of isWindow() method in jQuery:

Example 1: In this example, the isWindow() method finds if the word “window ” is a window or not.




<!DOCTYPE html>
<html>
  
<head>
    <meta charset="utf-8">
    <title>JQuery | isWindow() method</title>
    <script src=
    </script>
  
</head>
  
<body style="text-align:center;">
  
    <h1 style="color: green"
        GeeksforGeeks 
    </h1>
  
    <h3>JQuery | isWindow() method</h3>
    <b>Whether 'window' is a window : </b>
  
    <script>
        $("b").append("" + $.isWindow(window));
    </script>
</body>
  
</html>


Output:

Example 2: In this example, the isWindow() method finds if the word “window ” is a window or not.




<!DOCTYPE html>
<html>
  
<head>
    <meta charset="utf-8">
    <title>JQuery | isWindow() method</title>
    <script src=
    </script>
  
</head>
  
<body style="text-align:center;">
  
    <h1 style="color: green"
        GeeksforGeeks 
    </h1>
  
    <h3>JQuery | isWindow() method</h3>
    <b>Whether 'document' is a window : </b>
  
    <script>
        $("b").append("" + $.isWindow(document));
    </script>
</body>
  
</html>                                                  


Output:



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads