In the above example, we have selecting the paragraph element using javascript and appending text in it. We have also appended br tag in the text. When the text is rendered, each word in rendered on the next line.