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
Labels: javascript, JQuery, textarea
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment