what I\'m trying to do is converting a TextArea content into a valid html code. Suppose you type inside the TextArea and then you press a button that shows the typed text inside
Well, it's not very difficult:
$('#element').html($('textarea').html().replace(/\n/g, ""));