new line in div javascript code example Example: javascript create element in a new line var br = document.createElement("br"); element.appendChild(br);