Answer the question
In order to leave comments, you need to log in
How to format the text copied by the .text(); method?
var text1 = $(".wrap_info_calc p").text();
$(".wrap_box_info textarea").text(text1);
Answer the question
In order to leave comments, you need to log in
with hyphens,
each <p>
will be on a new line
var text1 = $(".wrap_info_calc p").map(function(){
return $(this).text();
}).get().join('\n');
$(".wrap_box_info textarea").text(text1);
var text1 = $(".wrap_info_calc p").map(function(){
return $(this.innerHTML.replace('<br>', '\n')).text();
}).get().join('\n');
$(".wrap_box_info textarea").text(text1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question