国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery node replacement

Node replacement

  • ##replaceWith(content): Replace all matching elements with the specified HTML or DOM element

  • ?????????????

    $("select").replaceWith(content);

  • $('select') is replaced by content

  • ##replaceAll(selector): Replace all selector matches with matching elements The element to

##????????????
    $('content').replaceAll(select);
  • ???????
  • Actively replace the select element with content

  • <!DOCTYPE html>
    <html>
        <head>
            <title>php.cn</title>
            <meta charset="utf-8" />
            <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
            <script>
            function  f1(){
                //主動(dòng)替換 replaceAll()
                $("#gai").replaceAll("#guan");
                //被動(dòng)替換  replaceWith()
                $("#big li:first").replaceWith($('#small li:first'));
            }
            </script>
            <style type="text/css">
            div {width:300px; height:200px; background-color:pink;}
            </style>
        </head>
        <body>
            <h2>節(jié)點(diǎn)替換</h2>
            <ul id="big">
                <li>A</li>
                <li>B</li>
                <li id="guan">C</li>
            </ul>
            <ul id="small">
                <li>a</li>
                <li>b</li>
                <li id="gai">c</li>
            </ul>
            <input type="button" value="替換" onclick="f1()" />
        </body>
    </html>
Continuing Learning
||
<!DOCTYPE html> <html> <head> <title>php.cn</title> <meta charset="utf-8" /> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <script> function f1(){ //主動(dòng)替換 replaceAll() $("#gai").replaceAll("#guan"); //被動(dòng)替換 replaceWith() $("#big li:first").replaceWith($('#small li:first')); } </script> <style type="text/css"> div {width:300px; height:200px; background-color:pink;} </style> </head> <body> <h2>節(jié)點(diǎn)替換</h2> <ul id="big"> <li>A</li> <li>B</li> <li id="guan">C</li> </ul> <ul id="small"> <li>a</li> <li>b</li> <li id="gai">c</li> </ul> <input type="button" value="替換" onclick="f1()" /> </body> </html>
submitReset Code