I have appended a <div> to the body of my page using
$('body').append('<div id="itemInfo"><h2>TEST</h2></div>');
This <div> is hidden in my css. I am then altering the text within the <div> using a function as follows.
function appendMessage(messagestring) {
$('#itemInfo h2').text(messagestring);
$('#itemInfo').fadeIn();
$('#itemInfo').fadeOut(3000);
}
This is declared using the following.
appendMessage("Something. ");
The problem is, I cannot seem to get <br /> or /n characters to work within the message. How do I use new line characters within the .text() function?
elements
– Bryant Frankford Aug 25 '15 at 20:17