Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application Or Any Help.Contact Us: +91 9437911966 (Whatsapp) Note: Paid Service

How to check an element is hidden in jQuery

<!Doctype html>
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <body>
        <script>
            $(document).ready(function() {
                var visible = $('#tElement').is(':visible');
                if (visible) {
                    alert("visible");
                } else {
                    alert("hidden");
                }
            });
        </script>
        Firstname:<input type="text" id="tElement" style="display:block;">
    </body>
</html>

Run it yourself


Download Source Code