Change .text
to .html
, as you are including html elements within your output.
Reference .html()
Pergunta
First let me starte that I've been psending the last 2 hours searching the web and trying solutions, nothing worked. I've been trying to make a new line in a Paragraph, but do'sent work. I'm using Jquery mobile and editing a paragraph with $('.selector').text(); from a javascript.
I got the follow code:
function popupBasicPris() {
$('#prisMatchPopup').text("Du har indtastet: <br />"+
"Pris: " + document.getElementById("textinputpris").value.toString() +
"<br /> Vil du sende?");
}
The code is run from a button click.
My problem is that it just writes
instead of making a new line in the shown text.
Solução
Change .text
to .html
, as you are including html elements within your output.
Reference .html()
Outras dicas
function popupBasicPris() {
$("#prisMatchPopup").html(
"Du har indtastet: <br /> Pris: " + $("#textinputpris").val() + "<br /> Vil du sende?"
);
}