It’s different between the two API swal(title, text)
and swal(option)
on showing multi line text.
const lines = ['line_1', 'line_2', 'line_3'];
swal(lines.join('<br>')); // it works
swal({ text: lines.join('<br>') }); // it does not work
Note: for Sweetalert2 Version 8.x and higher, the API has changed to Swal.fire(...)
.
- version 7.x demo in version 7.x
- version 9.x demo in version 9.x