I am creating a simple modal where I pass a string and that gets displayed as the content of the modal.
In a nutshell, I have this script:
$("[id^='mod_']").click( function() {
var line1 = $(this).attr("data-modaltext1");
$('#modalid').show();
$('#modalmessage').text(line1);
The above works as expected. But if my string I pass and picked up by data-modaltext1 is
"<p>Hello</p><p>World</p>"
It prints is as seen without the html tags working. I don't get two paragraphs. Just one string that looks exactly like
"<p>Hello</p><p>World</p>"
Any help will be appreciated.
.textto.html.