---
title: "JQuery hide part of text"  
description: "JQuery hide () function is used to hide element from page. By using hide () method we can hide matched element from page. In this article I am trying"  
author: "Sachindra Singh"  
published: 2011-02-22  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/468/jquery-hide-part-of-text  
category: "jquery"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# JQuery hide part of text

[JQuery hide](https://www.mindstick.com/forum/12913/jquery-hide-hides-what-it-shouldn-t) () [function](https://www.mindstick.com/articles/43970/purchase-suitable-wedding-dresses-for-your-wedding-function) is used to hide element from page. By using hide () [method](https://www.mindstick.com/forum/166/webservice-method) we can hide [matched](https://answers.mindstick.com/qa/95756/what-are-the-benefits-of-google-adsense-matched-content) element from page. In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to hide <div> element from page on [button click](https://www.mindstick.com/forum/568/check-condion-before-post-page-on-button-click-in-jquery-or-javascript).\

## Code:

```
<head>       <script type="text/javascript" src="jquery.min.js"> </script>       <script type="text/javascript">         $(document).ready(function()           {            $("div button").click(function             {                $(this).parents("div").hide("medium");// when button is clicked hide function will hide that particular <div> element from page            });         });     </script>  </head><body>     <h3>         JQuery Hide part of text example 1</h3>     <div>           jQuery is a library that makes it quicker and easier<br />         to build JavaScript webpages and web apps.<br />         <br />         <button> <!--button is define in div tag-->            Click to hide</button>     </div>     <h3>         JQuery Hide part of text example 2</h3>     <div>         JQuery hide method is use         <br />         to hide part of text from page<br /><br />         <button>            Click to hide</button>      </div></body></html>
```

![hide()function in JQuery](https://www.mindstick.com/mindstickarticle/33a9420d-dd5d-4c9c-88f5-482177a2df82/images/b573fb47-a9a7-4385-85f7-351b0f05030f.png)

When I will click on any particular button like I clicked on first button then text and button will hide but not heading as it is not in div tag as shown below:

![hide method in JQuery](https://www.mindstick.com/mindstickarticle/33a9420d-dd5d-4c9c-88f5-482177a2df82/images/42d11ce7-ebae-4937-9ca6-ccc256a78868.png)

![hide method in JQuery](https://www.mindstick.com/mindstickarticle/33a9420d-dd5d-4c9c-88f5-482177a2df82/images/4c92982f-a247-4444-8d4b-09d5631ac127.png)

---

Original Source: https://www.mindstick.com/articles/468/jquery-hide-part-of-text

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
