add(expr): adds more elements : add « jQuery « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
                
           
            
    $("div").add("p")
            .css("background", "yellow");


                    

        });
    </script>
  </head>
  <body>
    <body>
          <div>asdf</div>
          <div>asdf</div>
          <div>asdf</div>
          <div>asdf</div>
          
    </body>
</html>








30.12.add
30.12.1.Add tag returned from document.getElementById
30.12.2.add(expr): adds more elements
30.12.3.Adds one or more Elements to the set of matched elements(document.getElementById)
30.12.4.Add class to the result returned from an add function