Treehouse: Grow your CSS skills. Land your dream job.

Last updated on:

Basic Alert

<script type="text/javascript">
       alert('ALERT!')
</script>

Comments

  1. Dhaval

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

    thanks

  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

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:

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