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 7830953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:29:44+00:00 2026-06-02T11:29:44+00:00

I’ve got the following HTML code, which essentially pertains to a post where I

  • 0

I’ve got the following HTML code, which essentially pertains to a post where I announce something in just a few lines, end it with “[…]”, and add a “Read more” link-button at the bottom. When this button is clicked, additional content that’s hidden will fadeIn as the button disappears, leaving visible the introductory text and the one that was hidden — simple enough. Now, I’ve already written the code for this, but the complication comes when I try to also remove that “[…]” (from the post where the click button happened) that I included in the sneak peek. Here’s the HTML:

<div class="entry">
    <p>Welcome. Talk about something briefly and click below for more. [...]</p>    

    <div class="slide-content">
        <p>Hidden content.</p>
    </div>
    <span id="revealer" class="button"><a href="#">Read more</a></span>
</div>

Classes “entry” and “button” belong to my CSS file, while “slide-content” belongs to my .js file to control the fadeIn effect. The ID “revealer” also belongs to the .js file for the same purpose. This HTML is wrapped in a div tag with a class of “box”. This is the format that each post follows, exactly the same format with the same HTML elements — every time an announcement needs to be made, it’s just a matter of putting the content between the paragraph tags and publish. Here is where my problem comes in, since I can’t find a way to remove the “[…]” only in the post where the button has been clicked. I tried doing the following but it resulted in the deletion of all “[…]” throughout multiple posts:

$('.entry p').each(function() {
    var textReplace = $(this).text();
    $(this).text(textReplace.replace('[...]', '')); 
});

Summary:

  1. I need to remove the “[…]” text only from the post where the user has clicked on (the “Read more” button). The idea is to have this removed while at the same time the hidden content fades in.
  2. I’ve been able to accomplish the above but for all instances of “[…]”. I need to sophisticate my selection by modifying my jQuery code or the HTML.
  3. Option 3 is to get rid of this “[…]”, but I would like to leave it there to let the user know she has more content to read, and I would like to have that “Read more” button in all posts for consistency.

~Thanks in advance!

  • 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-02T11:29:47+00:00Added an answer on June 2, 2026 at 11:29 am

    First, you mention you have multiple of these. In that case, this:

    <span id="revealer" class="button"><a href="#">Read more</a></span>
    

    will not work. id attribute has to be unique per document, i.e. you can have at most one element with the specific id value.

    If you make your HTML (for each of the blocks) like this:

    <div class="entry">
        <p>Welcome. Talk about something briefly and click below for more. [...]</p>    
    
        <div class="slide-content">
            <p>Hidden content.</p>
        </div>
        <span class="revealer button"><a href="#">Read more</a></span>
    </div>
    

    and your JS like this:

    function replace(fromp) {
        var textReplace = fromp.text();
        fromp.text(textReplace.replace('[...]', ''));
    }
    
    $('.revealer').click(function() {
       var fromp = $(this).siblings().eq(0);
       replace(fromp);
    });
    

    it will work properly. Working example:

    • http://jsfiddle.net/G4t7Q/

    Hope this helps.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
i got an object with contents of html markup in it, for example: string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.