Question: Using jquery I want to do the following:

If a div contains more than 300 (text) characters then hide a particular link outside the div.

Answer: 
You need to check the length of the text of the `div`:

```
if($('div').text().trim().length > 300) {
    // stuff here
    // like:
    // $('#linkOutsideDiv').hide()
}

```
```js
$(document).ready(function(){
alert($('#divtext').text().length)
if($('#divtext').text().length>300)
{
$('#link').hide()
}
})
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="divtext">asssssssssssssssssssssssssssssddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</div>
<a href="#" value="Href" id="link">click here</a>
```