var addrs = $("#alamat").val(); var lines = addrs.split(/\n/); var texts = [] for (var i=0; i < lines.length; i++) { if (/\S/.test(lines[i])) { texts.push($.trim(lines[i])+'<br>'); } } alert(JSON.stringify(texts)); $("#dispAlamat").html(texts);
Javascript Papar Textarea Value Newline
Thursday, July 07, 2016
Posted by ayus at 5:14 AM 0 comments
Labels: javascript, JQuery, textarea
Subscribe to:
Posts (Atom)