Add a “new line” in innerHTML

The simplest way is by adding a line break as html

cellTwo.innerHTML = arr_title[element] + "<br />" + arr_tags[element];

If you want your newlines to be treated literally, you could use the <pre> tag

cellTwo.innerHTML = 
    "<pre>" + arr_title[element] + "\n" + arr_tags[element] + "</pre>";

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)