Edit in JSFiddle

$("#btnShowAlert").click(function() {
    sweetAlert(
        "Oops...", "Something went wrong!", "error"
    );
});

              
<button id="btnShowAlert">
    Show Sweet Alert
</button>