Append line-break after text
javascript, jquery
Solution
Markup
<div id='temp'></div>
JS
$('#temp').text("hello").html($("#temp").html() + "<br/> how do you do? "); //This is one way
$('#temp').html("hello").append("<br/> how do you do?"); //Yet another way using the 'append' method.
Fiddle
Problem
I'm trying to append a line break to a line of text I'm loading from an xml page using the following code: ``` $("#questionNumber").text(questionInARow).append('<br>'); ``` The text is loading okay, but the append is being ignored. I've also tried this: ``` $("#questionNumber").text(questionInARow).html("<br>"); ``` and this is ignored likewise. Is my syntax wrong, or my method just bad? Thank you in advance.