1
What are the use if clone method in JQuery?
What are the use if clone method in JQuery?
Syntax
$(selector).clone ( true| false )
Example
<!DOCTYPE html>
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js'></script>
<script>
$(document).ready(function(){
$('button').click(function(){
$('p').clone().appendTo('body').css({'background-color':'orange','color':'white'});
});
});
</script>
</head>
<body>
<p>MindStck pvt ltd in allahabad </p>
<button>Click me to clone data and add in html page</button>
</body>
</html>
