DEV Community

Sirb Alin Cristian
Sirb Alin Cristian

Posted on


Simple alert in JavaScript

create html file and write code

<!DOCTYPE html>
  <title>simple alert in javascript</title>
     <button onclick="press()">click here</button>

   div {
    display: flex;
    flex-direction: row;
    justify-content: center;

   button {
    border: 2px solid orange;
    background-color: orange;
    color: #fff;
    font-family: sans-serif;

   function press() {
     let notification = alert('Congrats!');
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Visualizing Promises and Async/Await 🤯

async await

☝️ Check out this all-time classic DEV post