I wrote a little jquery to resize my text area as you type, and it works fine unless I use a line break.
function resize() {
var value = $('textarea').val();
var div = $('div');
div.html(value);
var height = div.height();
/// etc.
}
<div style="display: none;"></div>
<textarea></textarea>
The text area and div have the same font and everything, so they align perfectly and the text area resizes accordingly, but when I use a line break (example: "one<br />two
") the output to the div ignores it ("one two
"). How do I make it include the line break?