Sweet Alert Documentation

Description

A beautiful replacement for javascript's "alert". SweetAlert automatically centers itself on the page and looks great no matter if you're using a desktop computer, mobile or tablet. It's even highly customizable.

Initialization

Initialize the plugin by referencing the necessary files:

<script src="sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="sweetalert.css">

Javascript Structure

Call the sweetAlert-function after the page has loaded

swal({
    title: "Error!",
    text: "Here's my error message!",
    type: "error",
    confirmButtonText: "Cool"
});