<script type="text/javascript"> var txtObj = document.getElementById("noteBody"); var trimTxt = txtObj.trim(); </script>