---
title: "What are the use if clone method in JQuery?"  
description: "What are the use if clone method in JQuery?"  
author: "Ethan Karla"  
published: 2021-07-28  
canonical: https://answers.mindstick.com/qa/93807/what-are-the-use-if-clone-method-in-jquery  
category: "web application"  
tags: ["web development", "web application development"]  
reading_time: 1 minute  

---

# What are the use if clone method in JQuery?

What are the use if clone [method in JQuery](https://www.mindstick.com/forum/156670/has-method-in-jquery)?

## Answers

### Answer by Ravi Vishwakarma

We are generally use the copy of data, from any specific work. In this JQuery has clone () [method](https://www.mindstick.com/articles/23411/the-most-effective-method-to-find-the-perfect-small-business-phone-system-for-your-business) for making duplicate data of selected elements. We are append this duplicate data in html page. It also makes copies of their child nodes, texts and attributes.

> 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>
```

Output ![What are the use if clone method in JQuery?](https://answers.mindstick.com/questionanswer/c1a88862-bc85-4284-bf0a-fe933aee9d5a/images/e291d340-0d87-46d1-a5de-479078e15ac3.png) \


---

Original Source: https://answers.mindstick.com/qa/93807/what-are-the-use-if-clone-method-in-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
