Following code is an example of text placed into a textarea from a database.
Get the value, trim the value, set the value:
var value = $('#inputPane').val(); value = $.trim(value); $('#inputPane').val(value);
Or in one line:
$('#inputPane').val($.trim($('#inputPane').val()));