Reputation: 51
What is the correct syntax to insert a line break in a string? I have tried '\n' but this doesn't work...? This is the string in question:
function layer0(){
document.getElementById('layerinfo').innerHTML = 'The Wembury Quest ran during June 2012 and was very popular in the parish. Over 400 quest packs were collected from the village school post office and local shops. The Quest was designed to encourage residents to go out into the parish and explore their local landscape. This layer shows the results from the letterboxes. For the letterboxes twelve locations were chosen, spread around the parish. They were picked to take participants to very different types of landscape and views. Some of them were places which they had visited before, and some were off the beaten track and were new to some Questers. All of the locations were found on public rights of way.';
Upvotes: 0
Views: 255
Reputation: 240010
\n
is the correct syntax for inserting a line break in a string. Your problem is that you don't want to insert a line break in a string. You want to insert the text <br>
in a string. The correct syntax for inserting the text <br>
in a string is <br>
.
Upvotes: 2