Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8079175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:01:24+00:00 2026-06-05T16:01:24+00:00

The html code is pasted into this url http://jsfiddle.net/nzYjV/ The div (id=input) contains the

  • 0

The html code is pasted into this url http://jsfiddle.net/nzYjV/

The div (id=”input”) contains the string of alphabet..
Between the “input” div and “d1” div, there are 34 character (including space).
Inside the “d1” div, there are 16 character (including space)
Finally, between ending of “d1” div and before end tag of “input” tag, there is 9 character (including space).

I have to show limited number of string and add link for viewing whole content e.g.

1)suppose string limit is 30,the output would be

a b c d e f g h i j k l m n o ... [a href="#"]view more[/a]

and output html would be

[div id="input"]a b c d e f g h i j k l m n o [/div]

2)But, if the string limit is 40, then the output would be

a b c d e f g h i j k l m n o p q r s t...  [a href="#"]view more[/a]

And the output html would be

[div id="input"]a b c d e f g h i j k l m n o p q [div id="d1"] r s t [/div][/div]

3) And, if the string limit is 55, then the output would be

a b c d e f g h i j k l m n o p q r s t u v q x y z a1 b1...  [a href="#"]view more[/a]

And the output html would be

[div id="input"]a b c d e f g h i j k l m n o p q [div id="d1"] r s tb u v w x y[/div]z a1 b1[/div]

i am able to get the inner text of “input” div and “d1” div. But, i am not able to get the last text “z a1 b1 c1”, if the 3rd condition is true.

Sorry for bad editing.. Please help me to solve this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:01:26+00:00Added an answer on June 5, 2026 at 4:01 pm

    Solved… using this js file
    https://github.com/tagedieb/jquery-truncate

    Another set of truncate..

    https://github.com/Poetro/jQuery-Truncate

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I pasted the code given in this link to a file called md5.js. http://www.webtoolkit.info/javascript-md5.html
I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
For a rich text editor that has to handle pasted HTML code from MS
My html code is: <div title=test class=xyz>Tesing</div> I want it to look like: <a
My HTML code: <p>NEWS</p> <p> <form action=news.php method=post> <center><input name=NEW type=submit id=new value=NEW/> <input
I have below html code in my aspx. <input type=hidden id=medicalLink value='<a href=/forms/contactus.aspx >Contact
I have html code like this <tr class=odd> <td><b>Reason for Termination:</b></td> <td>this has bunch
I have the following code: <div id=parentDiv> <a href=someurl> ... </a> </div> HTML inside
When you paste the following URL into IE: http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx , the link on the
I have the following code in my file to load a div with HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.