DEV Community


Posted on

How to add window alert on screen or Sweet Alert ?

Use Library

  • Sweet Alert
Enter fullscreen mode Exit fullscreen mode
  • Add the CDN link <script src=""></script>

Complete Code

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Sweer Alert</title>
    <script src=""></script>
      <h1>Sweet Alert</h1>
        Link :
        <a href="" target="_blank">
          Sweet Alert Website</a
      <button onclick="alertFunction()">Alert Function</button>
      alertFunction = () => {
        swal("Sweet Alert", "on Click function ", "success", {
          button: "OK",

Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)