When typing text into a textarea and it becomes wider than the area, the text is wrapped onto the next line. Is there a way I can programmatically determine when this happen
You can measure every line width using a "hidden" span.
If the line width is greater than the textarea width then the line is wrapped
demo here
function textWidth(txt, font, padding) {
$span = $('');
$span.css({
font:font,
position:'absolute',
top: -1000,
left:-1000,
padding:padding
}).text(txt);
$span.appendTo('body');
return $span.width();
}