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

rafatux picture rafatux  路  5Comments

daftspunk picture daftspunk  路  4Comments

mateuszjarzewski picture mateuszjarzewski  路  4Comments

yrshaikh picture yrshaikh  路  4Comments

vmitchell85 picture vmitchell85  路  6Comments