I want to put HTML into my text parameter, but I get stuff like this:
This is a bold sentence.
It actually shows the html tags instead of rendering the html. I have tried putting the html in the 'text' paramater, 'content' parameter and 'html' parameter. None work. Help
`var msg = $("
").html("User is not logged in or user's session has expired.
Please log in to continue.
");swal({
icon:"warning",
title:"Unable to validate user.",
content: msg,
buttons: {
login: {
text:"Login",
value:"Login"
}
}
});`
OK, ... I was able to display HTML by doing it direct through javascript, but it does not work when using jQuery (as above).
`
var msg = document.createElement("div");
msg.innerHTML = "
Either user is not logged in or user's session has expired.
Please log in to continue.
";
swal({ icon:"warning",
title:"Unable to validate user",
content: slider,
buttons:{
login: {
text:"Login",
value:"Login"
}
}
})
`
You'll have to create your DOM nodes using content. We might make this easier to do in the future using the React plugin for example.
Most helpful comment
You'll have to create your DOM nodes using content. We might make this easier to do in the future using the React plugin for example.