JQuery JavaScript Tutorial

< html>
  
    
    
        $(document).ready(function(){
                 
                   $("div").one('click', function () {
                      if ($(this).is(":first-child")) {
                        $("p").text(":first-child");
                      } else if ($(this).is(".blue,.red")) {
                        $("p").text("It's a blue or red div.");
                      } else if ($(this).is(":contains('asdf')")) {
                        $("p").text("It's asdf!");
                      } else {
                        $("p").html("It's nothing special.");
                      }
                    });
                    
        });
    
 
  
  
    
          
asdf

          asdf

          asdf

          
asdfasdf

          asdf

          

asdf