How to hide/show more text within a certain length (like youtube)

jquery read more/less toggle
dynamically shortened text with show more link using angular 4
jquery show more/less list items
read more text in html
jquery read more expand
show more show less jquery codepen
limit text length in php and provide 'read more' link
bootstrap show more text

I want to have a text to only be a certain amount of characters/length and after that length, I want to put a link to reveal the full length of the text.

The link will be (more...). And once the user clicks the link (more..) the rest of the text will slide down.

How would I accomplish this?

Heres an example.

blah blah blah blah blah (more...)

When the user clicks (more..), it will show the entire text.

NOTE: I am taking a about data in a table row/table cell, not just any text.

The secret about this effect, is wrapping the parts that you want to control with HTML tags.

}, function(){

<span class="teaser">text goes here</span>

<span class="complete"> this is the 
complete text being shown</span>

<span class="more">more...</span>

Online demo here:

I want to have a text to only be a certain amount of characters/length and after that length, I want to put a link to reveal the full length of the text. i want doing a project then i need something similiar like the "more" link I have a long text but i want to display only a certain number of text if i click on the "More" this link it will appear

$('#more').click(function(e) {
        'height': 'auto'

$(document).click(function() {
        'height': '40px'
Check working example at
With Animation

Click on Read more to expand the text. Click outside to minimize it again.

Show or Hide Paragraphs of Text and closing div tags, you can format your Text Element as needed. In this example, we're going to have the More link appear after the first <br>/gi,"<br>").split(/<br>/); var countLines = textArr.length; SurveyGizmo LinkedIn SurveyGizmo Twitter SurveyGizmo YouTube. You can use query criteria in Access to limit the results based on specific text values. For example the criterion, = "Chicago" shows all items that have the text Chicago . This article has several examples of query criteria that you can use with the Text data type that can help you get more specific query results and find the information that

I know this question is a little old (and has had it's answer selected already) but for those wanting another option that're coming across this question through Google (like I did), I found this dynamic text shortener:

Dynamically shortened Text with "Show More" link using jQuery

I found it was better because you could set the character limit, rather than extra spans in the code, or setting a specific height to a container. Hope it helps someone else out!

Flutter UI | How to hide or show more text within certain length. Ben Coder. Loading Duration: 10:31 Posted: Aug 31, 2019 Learn how to create a "read more - read less" button with JavaScript. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut

If you need some complete solution, you can use this :

JS (jQuery)

var text = $('.text-overflow'),
     btn = $('.btn-overflow'),
       h = text.scrollHeight; 

if(h > 120) {
    btn.css('display', 'block');

  if (btn.hasClass('less')) {
      btn.text('Show less');

      text.animate({'height': h});
  } else {
      btn.text('Show more');
      text.animate({'height': '120px'});


<script type="text/javascript" src=""></script>
<div class="text-overflow">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
<a class="btn-overflow" href="#">Show more</a> 


.text-overflow {
  word-break: break-word;
  word-wrap: break-word;

.btn-overflow {
  display: none;
  text-decoration: none; 

Dynamically hide text with show more button of the database, its fine as long as there are no html tags being used, in my var h = content.substr(showChar-1, content.length - showChar); var html This is where I'm trying out the script, the more button appears, and its clickable and you get some change  To pad cells to a fixed length, you just need a simple formula. Select the cells you want to use, type this formula =LEFT (A1&"*****",5), press Enter key, and drag fill handle over the cells as you need. In the formula A1 is the cell you use to fix length, * is the character you want to fill, 5 indicates to fix text length in 5 digits. See

For those who just want a simple Bootstrap solution.

    <style> { display: inline !important; }

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the
    <span class="collapse" id="more">
      1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
    <span><a href="#more" data-toggle="collapse">... <i class="fa fa-caret-down"></i></span>

Here's a CodePen example.

Remember to include jquery and bootstrap.min.js in your header.

If you aren't using fontawesome icons, change <i class="fa fa-caret-down"></i> to any icon of your choice.

It's a common need in web apps: you click something and the text of the thing Facebook Twitter YouTube Instagram RSS Perhaps something simple like a “​Show” button that swaps to “Hide”, #jQuery Way (Less Markup / More JavaScript) CSS isn't really meant for this kind of thing and likely has some accessibility  Flutter: How to hide or show more text within certain length – Sanjay Sharma 58 mins ago Not really, wanted to show the rest of the text in a overlay container, like we normally see in a website. – meditat 56 mins ago

Just by using some simple CSS can easily show and hide different In Text or Code mode, copy and paste the below code into your web opening and closing div tags (like photos, headings, youtube videos, galleries, etc…). You can also just resize your browser down to a mobile device size like this:. Hide/show more text within a certain length across multiple fields I want to have a text to only be a certain amount of characters/length and after that length, I want to put a link to reveal the full length of the text.

Don't write code like that — it might make it more art than product, but this is rarely a show(){ current = 1; }; function hide(){ show(); }; */ return{init:init,show:​show getElementsByTagName('input'); for(var i=0,j=inputs.length;i<j;i++){ if(​inputs[i]. Say for example you want to hide all DIVs with a certain class in a document.

<script type="text/javascript"> function showMe (it, box) { var vis = (box.checked) ? Hide the submit button on your form until certain fields are filled in. This option is built-in to Formidable, but there may be times where you want more Replace 125 with the ID of the field that triggers the hide/show. In this