Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What I want to do is to add textbox value into a textarea control once button clicked How can do it?I have tried something like this below

What I have tried:

$('#Buton').click(function () {
         $('#textarea').html("<br/>"+$('#mytextbox').val())
       })
Posted
Updated 29-Apr-22 19:47pm

$('button').on("click", function(){
  $('textarea').text('First line\nsecond line\nThird line');
})

Use \n for next line. br inserts a new line inside a block tag like div, p etc
 
Share this answer
 
12/12/2022 DATA
12/02/2022 MAN
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900