Saturday 29 October 2016

jQuery - Check if control is visible

watch this example on YouTube




<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
    <script  type="text/javascript" src="Scripts/jquery-1.10.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            if ($('#Button1').is(":visible")) {
                alert('visible');
            } else {
                alert('not visible');
            }
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Visible="true" Text="Button" />
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment