I am using sweet-alert plugin to display an alert. With a classical config (defaults), everything goes OK. But when I want to add a HTML tag into the TEXT, it display
I just struggled with this. I upgraded from sweetalert 1 -> 2. This library: https://sweetalert.js.org/guides/
The example from documentation "string" doesn't work as I expected. You just can't put it like this.
content: `my es6 string template`
How I solved it:
const template = (`my es6 string ${variable}`);
content: {
element: 'p',
attributes: {
innerHTML: `${template}`,
},
}
There is no documentation how to do this, it was pure trial and error, but at least seems to work.