I am tying to make a simple effect using keyup() in jQuery. I just want that when user types into the textarea then the text which user types will
You need to convert the literal newlines into tags for proper output in the DIV.
$('.'+contentAttr+'').html(value.replace(/\r?\n/g,'
'));
Shown in your code below:
$('.content:not(.focus)').keyup(function(){
var value = $(this).val();
var contentAttr = $(this).attr('name');
$('.'+contentAttr+'').html(value.replace(/\r?\n/g,'
')); //convert newlines into
tags
});
Texts Comes here
JSFiddle