I use this code.
I need click a area to select the username to insert
$('#r_user').click(function(){
$('#reply_comment_textarea').val($('#reply_comment_textarea').val()+$(this).attr('alt'));
});
<li id="r_user" alt="@tommy ">...something</li>
I planing the user is click the li area...
will get the alt content insert to the textarea (#reply_comment_textarea)
the page will be have many li#r_user and textarea#reply_comment_textarea
eg...
<li id="r_user" alt="@tommy ">...something</li>
<li id="r_user" alt="@peter ">...something</li>
<li id="r_user" alt="@kate ">...something</li>
<textarea id="reply_comment_textarea"></textarea>
<li id="r_user" alt="@tom ">...something</li>
<li id="r_user" alt="@tony ">...something</li>
<textarea id="reply_comment_textarea"></textarea>
<li id="r_user" alt="@tommy ">...something</li>
<textarea id="reply_comment_textarea"></textarea>
how can I click the li#r_user will be insert the alt content to next #reply_comment_textarea
Now mycode only available for the first li tag?