<!doctype html>
<html lang= "en" > <head> <meta charset= "Utf-8" > <title> a JavaScript instance per day-processing textarea characters Fu Cheng each line </title> <script> function Clicka () { console.log ("AAA"); var AA = document.getElementById ("text"); var lines = Aa.value.split ("n"); var bbb = document.getElementById (" Result "); var string =" "; for (i=0;i<lines.length;i++) { string+= lines[i]+ "<br/>";////</br> and <br/> should be used <br/> sp; } bbb.innerhtml=string } </script> </head> <body > <textarea id= "text" placeholder= "Please enter multiple lines of text" ></textarea> <div id = "Result" ></div> <a href= "javascript:void (0);" onclick= "Clicka ()" > Process line Wrap </a> </body> </html>