<! docType html> <html lang = "en"> <head> <meta charset = "utf -8"> <title> 하루에 하나의 JavaScript 인스턴스 - 텍스트의 문자를 각 줄에 핸들링합니다 </title> <cript> function clicka () {console.log ( "aaa"); var aa = document.getElementById ( "text"); var lines = aa.value.split ( "/n"); var bbb = document.getElementById ( "결과"); var string = ""; for (i = 0; i <lines.length; i ++) {string+= lines [i]+"<br/>"; //// </br> 및 <br/>는 <br/>} bbb.innerhtml = string} </script> </head> <body> <TextArea id = "text"place eld "를 입력해야합니다. "결과"> </div> <a href = "javaScript : void (0);" onclick = "clicka ()"> 핸들 선 브레이크 </a> </body> </html>