My div of "description" class pulls in the following from an array:
[{ "id": "1", "text": "There are two.\n\nThe first one is..."}]
How can I ensure instead of it just creating the space it replaces the \n\n
with a <br /><br />
?
I've tried
document.getElementById(".description").innerHTML = myObj.text.replace(/\n/g,"<br /><br />");
but no luck.