---
title: "JQuery get method"  
description: "JQuery get () method is use to get DOM element by selector. In this article I am trying to show you, how we can use get () method on page. In this exa"  
author: "Sachindra Singh"  
published: 2011-02-21  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/477/jquery-get-method  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# JQuery get method

JQuery get () method is use to get DOM element by selector. In this article I am trying to show you, how we can use get () method on page. In this example I am trying to copy all data of <div> element and want to append in another <div> element as shown below:\

##### Code:

```
<head runat="server"><title>JQuery get method</title> <script type="text/javascript" src="jquery.min.js">     </script>       <script type="text/javascript">           $(document).ready(function()        {            $("button").click(function             {                 $("#div2").text($("#div1").get(0).innerHTML //in this line all text of div1 will copy in div2 and get method that is parametrized is used for to access the element in Nth position            });           });     </script>     <style type="text/css">         .style1         {            width: 163px;         }     </style></head><body><h2>JQuery get method</h2>     <table width="400" cellspacing="5">         <tr>            <td align="center">                <h3>Div element 1.</h3>            </td>            <td align="center" class="style1">                <h3>Div element 2.</h3>            </td>         </tr>         <tr>            <td align="center">                <div id="div1">                   In JQuery, get () method is use to get DOM element by selector. JQuery get ()                    method is use to get data from server by using Get http request. This is an easy                    way to send simple request to server. In this article trying to show how we can                    use get () method.</div>            </td>            <td align="center" class="style1">                <div id="div2">                </div>            </td>         </tr>         <tr>            <td align="center" colspan="2">                <button>                    Copy data</button>            </td>         </tr>     </table></body>
```

##### Screenshot

![JQuery get method](https://www.mindstick.com/mindstickarticle/9e1e3aa3-83a6-474c-a794-7da8a9e039b2/images/bf388182-ef38-4be4-9013-acebb32638b1.png)

When I will clicked on button data will show on Div element 2 as shown below:

##### Screenshot

![JQuery get method](https://www.mindstick.com/mindstickarticle/9e1e3aa3-83a6-474c-a794-7da8a9e039b2/images/41aea70b-3f7f-486f-8250-78b232cb7c39.png)

\

\

---

Original Source: https://www.mindstick.com/articles/477/jquery-get-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
