The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Basic Alert

Last updated on:
<script type="text/javascript">


  1. Dhaval

    This is very nice as a designer i have to find some where else and not get proper way for alert


  2. TutorialsFor

    Will this alert on by clicking or on page load ?

  3. Julia
    Permalink to comment#

    Wonderful, I was looking everywhere on the internet since hours to know how to do such a thing, now I’m gunna do that on all my website page !!

    But I still have a question though, is it possible to change the message ALERT! into something else, like HELLO! or something ?

    Thanks for your help !

    • Elijah
      Permalink to comment#

      Julia, yes you can. You just edit the “ALERT!” to whatever you want it to be.

  4. Reem
    Permalink to comment#

    it is very easy please upload more examples so i can clear the concept

  5. Oria
    Permalink to comment#

    Here’s a simple non-modal replacement for the alert:

  6. Oria
    Permalink to comment#

    Here’s a simple non-modal replacement for the alert function:

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in in triple backtick fences like this:

  function example() {
    element.innerHTML = "<div>code</div>";

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed