Search results

Severities in JavaScript (ES5) Message control

06 Jun 2023 / 1 minute to read

The severity denotes the importance and context of the message to the user. The message contains different severity types. Use the severity property to display the messages with different severity levels.

The available severity types are Normal, Success, Info, Warning and Error. The default severity type for messages is Normal.

The following example demonstrates the severity of the messages.

Copied to clipboard
var msgDefault = new ej.notifications.Message({
    content: "Editing is restricted"

  var msgInfo = new ej.notifications.Message({
    content: "Please read the comments carefully",
    severity: "Info"

  var msgSuccess = new ej.notifications.Message({
    content: "Your message has been sent successfully",
    severity: "Success"

  var msgWarning = new ej.notifications.Message({
    content: "There was a problem with your network connection",
    severity: "Warning"

  var msgError = new ej.notifications.Message({
    content: "A problem occurred while submitting your data",
    severity: "Error"
Copied to clipboard
    <title>Essential JS 2 Message control</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Essential JS 2 Message control">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
    <link href="//" rel="stylesheet">
<script src="" type="text/javascript"></script>

    <div id="container">
        <div class="msg-default-section">
            <div class="content-section">
                <div id="msg_default"></div>
                <div id="msg_info"></div>
                <div id="msg_success"></div>
                <div id="msg_warning"></div>
                <div id="msg_error"></div>
        /* Sample level styles */
        .msg-default-section .content-section {
            margin: 0 auto;
            max-width: 450px;
            padding-top: 10px;
        .msg-default-section .e-message {
            margin: 10px 0;

var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>