jQuery isWindow() example

jQuery isWindow() function is used to determine whether the argument is a window.

Syntax

jQuery.isWindow( obj )
obj - Object to test whether or not it is a window.

Example

Finds out if the parameter is a window.
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>jQuery.isWindow demo</title>
    <script src="https://code.jquery.com/jquery-3.4.1.js"></script>
</head>

<body>

    Is 'window' a window? <b></b>

    <script>
        $("b").append("" + $.isWindow(window));
    </script>

</body>

</html>
Try it Yourself - Copy paste code in Online HTML Editor to see the result
Output:
Is 'window' a window? true

References


Comments