Within my HTML, I have to change a "-" to a carriage return (<br />). I have to achieve that through jQuery.
Hence, for my following HTML:-
First sentence - Second Sentence
I did this:-
caption = caption.replace("-", "<br /><br />");
$('.jcarousel-caption').text(caption);
Result:-
First Sentence <br /><br /> Second Sentence
I even tried to change my jQuery to:-
caption = caption.replace("-", "<br /><br />");
caption.replace('<','<').replace('>','>').replace('"','"');
$('.jcarousel-caption').text(caption);
But it still shows the same output.
I want to achieve this:
First sentence
Second Sentence