Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen a link is clicked, grab the contents of another class
    primarykey
    data
    text
    <p>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 <code>@USERNAME</code></p> <p>Below is the output from my Wordpress comment. On line 6 there is a link that has a Class name <code>url</code> and the links text is <code>jasondavis</code></p> <p>Down farther down on line 15 there is the Reply link, it has a class of <code>comment-reply-link</code></p> <p>When a user clicks on that reply link, I am trying to get the Username in this case <code>jasondavis</code> so I can later insert it into the textarea box.</p> <p>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 <code>.url</code> but only from the <code>.url</code> that directly precedes the reply button for that particular comment that the reply button/link was clicked from.</p> <p>If you have any tips or can help I would appreciate it</p> <pre><code>&lt;li class="comment byuser comment-author-jasondavis bypostauthor even depth-2" id="comment-6"&gt; &lt;div class="c-grav"&gt;&lt;img alt="" src="http://1.gravatar.com/" class="avatar avatar-60 photo" height="60" width="60"&gt;&lt;/div&gt; &lt;div class="c-arrow"&gt;&lt;/div&gt; &lt;div class="c-body"&gt; &lt;div class="c-head"&gt; &lt;a href="http://www.codedevelopr.com/" rel="external nofollow" class="url"&gt;jasondavis&lt;/a&gt; &lt;span class="c-date"&gt;December 30, 2011 8:00pm&lt;/span&gt; &lt;/div&gt; &lt;p&gt;Comment body text is here......&lt;/p&gt; &lt;span class="edit-comment"&gt; &lt;a class="comment-edit-link" href="" title="Edit comment"&gt;Edit&lt;/a&gt; &lt;a href=""&gt;Delete&lt;/a&gt; &lt;a href=""&gt;Spam&lt;/a&gt; &lt;a class="comment-reply-link" href="/codedevelopr/php-database-class/?replytocom=6#respond" onclick="return addComment.moveForm(&amp;quot;comment-6&amp;quot;, &amp;quot;6&amp;quot;, &amp;quot;respond&amp;quot;, &amp;quot;5&amp;quot;)"&gt;Reply&lt;/a&gt; &lt;/span&gt; &lt;/div&gt;&lt;!--end c-body--&gt; &lt;/li&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload