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

  • SEARCH
  • Home
  • 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 8083201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:23:11+00:00 2026-06-05T17:23:11+00:00

I have a page with several .desc divs. I want to add some html

  • 0

I have a page with several .desc divs. I want to add some html to the last paragrahs within these divs.

I have tried this..

$(".desc p:last").append(" <span class='orange readMore'>Read More</span> <span class='orange readLess'>Read Less</span>");

However this just adds it to the last paragraph of that div in the whole page. Not to each last paragrapgh within .desc div. If this makes sense…

<div class="desc">

                <p>Description1</p> 
            </div>
<div class="desc">
                <p>Description2 <span class="orange readMore" style="display: inline; ">Read More</span> <span class="orange readLess" style="display: none; ">Read Less</span></p> 
        </div>
  • 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-05T17:23:12+00:00Added an answer on June 5, 2026 at 5:23 pm
    $(".desc").each(function(){
        $(this).find('p:last').append("<span class='orange readMore'>Read More</span> <span class='orange readLess'>Read Less</span>");
    });
    

    Something like this maybe?

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

Sidebar

Related Questions

I have a page which contains several forms. I want to add a single
I'm at a standstill with this code. I have one page with several divs,
I have an AngularJS page with several form inputs. When the some of the
i have a page that contains several submit buttons however i only want one
I have a page containing several divs with the same class name for CSS
I have a page with several Ajax.InPlaceEditor fields. Some are single line (text input
I have a page with several iframes. One of this iframes has a page
I have a page with several div's. All of the divs have a unique
I have HTML page with several frames on it. One of frames(called Main) contains
I have heavy HTML-page with several megabytes of images and scripts. I'd like to

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.