I am trying to do something like this:
<p> Line 1 <br/> Line 2 <br/> </p>
This does not work, but is what i'm trying to do possible?
Edit: more info
i am executing this line of code: $("#textDialogBox").text("test<br />test2");
where #textDialogBox
is <p id = "textDialogBox">This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
But when I open the dialog box the
shows up as text, rather than a line break.
To use this shortcut, move to the text cursor to where you want the new line to begin. Then, press and hold the Shift key, and press the Enter key. If this keyboard shortcut does not work, it is likely only possible to enter a new line by manually inserting a line break ("<br>" tag) in the document's HTML code.
In this event, try p {display:inline}; to modify the display property. The preceeding CSS will remove the line-break by default. Depending on your criteria, you can modify it to reference a specific element or class. p {display:inline;} is full correct code to deactivate line feed with css of tag p.
<br>: The Line Break element. The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.
You can insert line breaks in HTML with the <br> tag, which is equivalent to a carriage return on a keyboard.
Have this instead:
$("#textDialogBox").html("test<br/>test2");
The text() method of jQuery will "destroy" any HTML given to it, and this includes <br />
as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With