Sweetalert: How do I include Javascript Variables inside the message?

Created on 13 May 2016  ·  3Comments  ·  Source: t4t5/sweetalert

How do I include Javascript Variables inside the message?

swal({ title: "Error!", text: "Javascript Variable?" type: "error", confirmButtonText: "Cool" });

Most helpful comment

var myVariable = 'Hello World'; swal({ title: "Error!", text: myVariable, type: "error", confirmButtonText: "Cool" });

All 3 comments

var myVariable = 'Hello World'; swal({ title: "Error!", text: myVariable, type: "error", confirmButtonText: "Cool" });

@t4t5 @WeirdestYeti @zenflow how can I edit the color of the text after assigning a variable to it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lusitaniae picture Lusitaniae  ·  4Comments

girishbr picture girishbr  ·  5Comments

yrshaikh picture yrshaikh  ·  4Comments

mateuszjarzewski picture mateuszjarzewski  ·  4Comments

fracz picture fracz  ·  4Comments