you need to make a pop-up window when the user clicks the wrong place, there may be several errors, respectively, they should appear one above the other and fade out. In the code that I wrote the error is that if you click too fast some blocks do not apply fadeOut and they do not disappear
function error(head, messege) { number += 1; $(".error-container").append('<div class="error-messege error-messege-' + number + '"></div><h2>' + head + '</h2><p>' + messege + '</p></div>'); $('.error-messege-' + number + '').fadeIn("fast"); setTimeout(function() { $('.error-messege-' + number + '').fadeOut(5000); }, 10000); }; $("#click").click(function() { error("Edit error!", "choose another answer"); }); .error-messege { width: 336px; text-align: center; background: #1c2942; color: #ce4d76; padding: 22px; border-radius: 4px; margin-bottom: 25px; position: relative; } .error-messege h2 { padding-bottom: 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5pt; } .error-messege p { font-size: 14px; letter-spacing: 1.5pt; } .error-container { position: fixed; bottom: 30px; right: 150px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="error-container"></div> <button id="click">click here</button>