<! doctype html> <html lang = "en"> <éadf> <meta charset = "utf-8"> <tapie> Une instance javaScript par jour - gère les caractères dans textarea dans chaque ligne </tdicat> <script> function clicka () {console.log ("aaa"); var aa = document.getElementById ("texte"); var lignes = aa.value.split ("/ n"); var bbb = document.getElementById ("résultat"); var string = ""; pour (i = 0; i <line.length; i ++) {string + = lignes [i] + "<r />"; ///// </br> et <r />> devraient être utilisés avec <r />} bbb.innerhtml = string} </ script> </ head> <body> <TextArea id = "text" lieux = " "Résultat"> </div> <a href = "javascript: void (0);" onClick = "clicka ()"> Handle Line Breaks </a> </ body> </html>