0
<script>
jQuery(document).ready(function($){

$('#user-submitted-title').on('keyup',function(e){
  $('#user-submitted-content').val('Watch this video'+ $(this).val() +'.');
});

});
</script>

This will result in: Watch this video xxx.

I want to add more sentences in new rows... ass example...

val('Watch this video'+ $(this).val() +'.');
val('Watch this best video'+ $(this).val() +'.');
val('Watch this great video'+ $(this).val() +'.');
val('Watch this something'+ $(this).val() +'.');
val('Watch this that'+ $(this).val() +'.');

All this in up function, how?

Elma Elma
  • 17
  • 5

1 Answers1

0

Not sure how you are setting the textarea content, but if you use the jQuery val method, \n works consistently in Firefox and IE (Including IE8):

try this : val('Watch this video'+ $(this).val() +'. \n')

var txt = $("textarea#idhere"); txt.val( txt.val() + "\nSomething here\n\nAgain"); Check below link and it's answer for more help!

jQuery textarea append newline behavior1

DEMO

Mr. Aniket
  • 83
  • 11