A example that using JQuery clone

rgqancy發表於2017-04-06
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("body").append($("p").clone());
  });
});
</script>
</head>
<body>
<p>
<input type="text" >
<select >                                
<option value="">全部</option>                                    
<option value="CNY">人民幣</option>
<option value="USD">美元</option>
<option value="JPN">日元</option> </select> This is a paragraph. </p> <button>複製每個 p 元素,然後追加到 body 元素</button> </body> </html>

 

相關文章