Jquery JavaScript DHTML


  
    
    
        $(document).ready(function(){
    function showParents() {
            
              var len = $("span")
                               .parents("div")
                               .css("border", "2px red solid")
                               .length;
              $("b").text("Unique div parents: " + len);
            }
            $("span").click(function () {
             
              showParents();
            });
        });
    
    
    
  
  
    
        

          
span

          span
        

        

          span