Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • jQuery Selectors

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 119
    Comment on it

    jQuery selectors gives you the facility to select and manipulate HTML elements according to your needs and requirements.

    The element Selector
    Based on the element name,The jQuery selector element selects elements.

    Example

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            $("p").hide();
        });
    });
    </script>
    </head>
    <body>
    
    <h2>This is Evon Technologies</h2>
    
    <p>This is a paragraph.</p>
    <p>This is Logic simplified.</p>
    
    <button>Click</button>
    
    </body>
    </html>
    

    The #id Selector

    For finding the specific element,the id attribute of an HTML element is used. An id should be unique in a page
    Example

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            $("#t").hide();
        });
    });
    </script>
    </head>
    <body>
    
    <h2>This is Dehradun</h2>
    
    <p>This is a meerut.</p>
    <p id="t">Haldwani.</p>
    
    <button>Click </button>
    
    </body>
    </html>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: