make div into textarea code example Example: convert elment in div to textarea with newline $(this).val().replace(/\r\n|\r|\n/g,"<br />")