Minimal Alert Message In Plain JavaScript – Msg.js

Category: Javascript , Notification | February 17, 2022
Views Total:178 views
Official Page:Go to website
Last Update:February 17, 2022


Minimal Alert Message In Plain JavaScript – Msg.js


An ultra-light JavaScript library that enables you to display an animated, fixed alert notification on the page.

How to use it:

1. Import the minified version of the Msg.js library.

<script src="msg.min.js"></script>

2. Call the message() function and define the text to be displayed in the alert notification.

message("Hello World!");

3. Override the default styles of the alert notification.'msg 1s linear';
div.setAttribute('id', 'div_Msg') = 'lightblue';'fixed';'flex';
div.innerHTML='&nbsp;<center><h3 style="cursor: default;" class="msg-text">'+text+'</h3></center><button onclick="closeMsg()" class="msg-text" style="cursor: pointer; background-color: transparent; border: 0px; outline: none; color: grey;">&nbsp;&nbsp;X&nbsp;</button></center>';'10px';'10px';"monospace";

You Might Be Interested In:

Leave a Reply