# getAlert()

Messages can be displayed with the function `getAlert()`. Let's say you want to display the message "Your change has been successfully saved" in a green bar, then use the function as follows:

```cfscript
getAlert('Your change has been successfully saved')
```

You can also work with the language variables from the table "system\_translations" as well as "custom\_translations" here, or with your own sentences. If you want to use such a language variable, simply write:

```cfscript
getAlert('txtActivateThisUser')
```

You can also specify the color of the bar by adding one of the following attributes:

* info (<mark style="color:blue;">blue</mark>)
* warning (<mark style="color:orange;">orange</mark>)
* danger (<mark style="color:red;">red</mark>)
* success (default, <mark style="color:green;">green</mark>)

Example:

```cfscript
getAlert('alertErrorOccured', 'danger')
```

Without any attribute, green (success) is used by default.
