Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make text bold with sweetalert in 2018?

I saw that you could use the content option, but im not really sure how to go about that right now I have something like:

swal({title: 'hello', text: 'hello ${<strong>{name}</strong>}', icon: 'success' })

like image 464
Taylor Austin Avatar asked Dec 10 '22 07:12

Taylor Austin


1 Answers

Or, you can use SweetAlert2 - the supported fork of original SweetAlert:

Swal.fire({
  html: 'Overengineering is <strong>a bad thing</strong>'
})
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

PS. notice that SweetAlert2 is a little bit different from SweetAlert, check the simple migration guide: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2

like image 158
Limon Monte Avatar answered Dec 30 '22 22:12

Limon Monte