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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:02:23+00:00 2026-05-28T02:02:23+00:00

I am trying to take the WordPress reply button for comments and making it

  • 0

I am trying to take the WordPress “reply” button for comments and making it grab the username of the comment you are replying to and post it into the comment textarea box like @USERNAME

Below is the output from my WordPress comment. On line 6 there is a link that has a Class name url and the links text is jasondavis

Down farther down on line 15 there is the Reply link, it has a class of comment-reply-link

When a user clicks on that reply link, I am trying to get the Username in this case jasondavis so I can later insert it into the textarea box.

I think this can be done with jQuery, assume there are multiple of these comments on the page so when the Reply link is clicked, it has to be smart enough to get the text from .url but only from the .url that directly precedes the reply button for that particular comment that the reply button/link was clicked from.

If you have any tips or can help I would appreciate it

<li class="comment byuser comment-author-jasondavis bypostauthor even depth-2" id="comment-6">
    <div class="c-grav"><img alt="" src="http://1.gravatar.com/" class="avatar avatar-60 photo" height="60" width="60"></div>
    <div class="c-arrow"></div>
    <div class="c-body">
        <div class="c-head">
            <a href="http://www.codedevelopr.com/" rel="external nofollow" class="url">jasondavis</a>
            <span class="c-date">December 30, 2011 8:00pm</span>
        </div>
        <p>Comment body text is here......</p>

        <span class="edit-comment">
            <a class="comment-edit-link" href="" title="Edit comment">Edit</a>
            <a href="">Delete</a>
            <a href="">Spam</a>
            <a class="comment-reply-link" href="/codedevelopr/php-database-class/?replytocom=6#respond" onclick="return addComment.moveForm(&quot;comment-6&quot;, &quot;6&quot;, &quot;respond&quot;, &quot;5&quot;)">Reply</a>
        </span>
    </div><!--end c-body-->
</li>
  • 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-05-28T02:02:23+00:00Added an answer on May 28, 2026 at 2:02 am

    Assuming your comment ul has an ID of comments:

    $("#comments").on('click', '.comment-reply-link', function(e) {
        var name = $(this).parents('.comment').first().find('.url').text();
        alert('replying to ' + name);
        e.preventDefault();
    });
    

    Try it on JSFiddle.

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

Sidebar

Related Questions

I am trying to alter the default preview post button when posting on wordpress
I am trying to take a rather large CSV file and insert it into
I'm trying to take a CGImage and copy its data into a buffer for
trying to take a line of text and tokenize it into a filename and
I'm trying to take a string, and convert it into a variable name. I
I'm trying to take the basic youtube embed code and bbreak it up into
I have a datagridview with 9 columns. I am simply trying take the value
Im trying to take a link either when clicked or hover over be able
I'm trying to take a POCO object and update it with Linq2SQL using an
So I'm trying to take a bilinear interpolation algorithm for resizing images and add

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.