jqueryによるノードの制御処理

1763 ワード


   //      
    $("#id").next();//     
    $("#id").prev();//     

    ////          
    $("p").append("<b>   ?</b>");// p     《b》 
    $("<b>   ?</b>").appendTo("p");// 《b》   p    
    $("p").prepend("<b>   ?</b>");// p   《b》 
    $("<b>   ?</b>").prependTo("p");// 《b》   p    
    $("p").after("<b>   ?</b>");// p     《b》 
    $("<b>   ?</b>").insertAfter("p");// 《b》   p     
    $("p").before("<b>   ?</b>");// p      《b》 
    $("<b>   ?</b>").insertBefore("p");// 《b》   p     
   
   
    //          
    var $li=$("ul li:eq(1)").remove();//  ul    2      
    $("ul").append($li);//              ul     
    $("ul li").remove("li[title!=  ]");// ul   title     "  " li     
    $("ul li:eq(1)").empty();//  ul    2 li      
   
    //     
   $("ul li").click(function(){ 
     $(this).clone(true).appendTo("ul");//         ,      《ul》   ,             
   
    }); 
    
    //     
   $("p").replaceWith("<strong>         ?</Strong>"); 
   $("[name='rp']").replaceWith("<tr><td>gg</td><td>gg</td><td>gg</td><td>gg</td></tr><tr><td>gg</td><td>gg</td><td>gg</td><td>gg</td></tr>");