<! Doctype html> <html lang = "en"> <head> <meta charset = "UTF -8"> <Title> satu instance JavaScript per hari - menangani karakter dalam tekstara ke dalam setiap baris </iteme> <script> function clicka () {console.log ("aaa"); var aa = document.geteLementById ("text"); var lines = aa.value.split ("/n"); var bbb = document.geteLementById ("hasil"); var string = ""; untuk (i = 0; i <line.length; i ++) {string+= lines [i]+"<br/>"; ///// </br> dan <br/> harus digunakan dengan <br/>} bbb.innerHtml = string} </script> </head> <body> <textarea id = "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text "Text" Text " "Hasil"> </div> <a href = "javascript: void (0);" OnClick = "clicka ()"> Handle Line Breaks </a> </body> </html>