I need to use JavaScript to remove blank lines in a HTML text box. The blank lines can be at anywhere in the textarea element. A blank line can be just a return
textarea
This should do the trick i think:
var el = document.getElementsByName("nameOfTextBox")[0]; el.value.replace(/(\r\n|\n|\r)/gm, "");
EDIT: Removes three types of line breaks.