javascript - Pull value from <li> in to <textarea> when <li> is clicked -
i have textarea
inside form needs populate text inside li
tag user clicks.
for example:
<ul id="selections"> // row1 <li>here text</li> // row 2 <li>here more text</li> // row 3 <li>here more text</li> </ul>
when user clicks row 1, need text pop in textarea. when user clicks row 2 now, need row 2 pop in textarea, undernieth row 1.
any ideas on how this?
try:
$('#selections li').click(function() { $('#id-of-your-textarea').append($(this).text() + '\n'); })
Comments
Post a Comment