pbalazek pbalazek - 1 year ago 158
Javascript Question

sweet-alert display HTML code in text

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

without making it bold. After searching for the answer, it looks like I don't have the right search word...

How to make sweet alert display the text also with HTML code?

var hh = "<b>test</b>";
title: "" + txt + "",
text: "Testno sporocilo za objekt " + hh + "",
confirmButtonText: "V redu",
allowOutsideClick: "true"

Answer Source

The SweetAlert repo seems to be unmaintained. There's a bunch of Pull Requests without any replies, last merged pull request was on Nov 9, 2014.

I created sweetalert2 with HTML support in modal and some other options for customization modal window - width, padding, Esc button behavior, etc.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download