N
N
Name2018-01-30 15:29:58
JavaScript
Name, 2018-01-30 15:29:58

Exclude element on selection?

Exclude element on fetch (JQUERY)?

https://jsfiddle.net/8rhrzdzL/

<div id="t4">
<div id="no">no no no</div>
<p>123</p>
</div>
<span id="1">Клик</span>
<textarea></textarea>


$("#1").click(function(){ 
$("textarea").val($("textarea").val() + $('#t4').text());})


on click in texarea inserts everything:
no no no
123

you need to insert only on click:
123

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-01-30
@User782

Replace: with:
$('#t4 p').text()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question