error block

PHOTO EMBED

Sun Jul 23 2023 08:56:22 GMT+0000 (Coordinated Universal Time)

Saved by @nelson22

errorBlock("#error_block","Username or Password is Incorrect");
successBlock("#success_block","Username added successfully");

<span id="error_block"></span> 
<span id="success_block"></span>

function successBlock(success, msg){
	$(success).empty();
	$(success).append(msg);
	$(success).show();
	setTimeout(function(){  $(success).hide(); }, 3000);
}

function errorBlock(err, msg){
	$(err).empty();
	$(err).show();
	$(err).append(msg);
	setTimeout(function(){  $(err).hide(); }, 3000);
}

#error_block{
	position: fixed;
    top: 10px;
    right: 10px;
    display: none;
    background: #e3000f;
    color: #fff;
    z-index: 9999;
    padding: 2px 10px;
    border-radius: 3px;
    min-width: 200px;
}

#success_block{
	position: fixed;
    top: 10px;
    right: 10px;
    display: none;
    background: #76b827;
    color: #fff;
    z-index: 9999;
    padding: 2px 10px;
    border-radius: 3px;
    min-width: 200px;
}
content_copyCOPY