Author Photo
Christopher Unum I am a software Developer, I write web development tutorials, I also mentor aspiring web developers. s

how to create a simple web popup notifier using vanilla javascript and jquery

Having a popup notifier on your website or web applications can help keep your website visitors informed on what's new or serve ads as they browse your site. In this tutorial we will create a simple popup notifier.


In this tutorial, we will make use of Html, CSS, JavaScript and some Jquery.


 <div id="popup" onmouseover="mouseIn()" onmouseout="mouseOut()">
<div id="popup-in">
<p id="popup-message"></p>


 #popup {
position: fixed; /*Gives the notifier a fixed position*/
z-index: 13; /*Places the notifier on top of all elements with a lesser z-index*/
background: #36a9d6;
margin: 10px;
border-radius: 5px;
width: 200px;
padding: 10px 0;
display: none;
cursor: pointer;

#popup-in {
width: 90%;
margin-left: auto;
margin-right: auto;
text-align: center;
color: #f4f4f4;


 <script src=""></script>
function element(id) {
return document.getElementById(id);

//adds an event listener on a button that displays notification
element("showNotification").addEventListener("click", function () {
showPopup("You've got Mail");

//holds timeout information
var myVar;

//displays the notifier
function showPopup(message) {
//includes the message in the notifier

//makes the notifier visible

//sets 5 seconds timeout
myVar = setTimeout(function () {
}, 5000);

//clears Timeout when mouse is in the notifier area
function mouseIn() {

//adds Timeout when mouse is out of the notifier area
function mouseOut() {
myVar = setTimeout(function () {
}, 5000);


Creating a simple web notifier is pretty straight forward. How you popup the notifier may vary depending on the type of website you are creating. Thanks for coming, see you in the next tutorial.