You can styling your own popup. Or use some plugins.

http://jquerybyexample.blogspot.com/2013/01/jquery-popup-window-tutorial-plugins.html

Or you can create some element on the page, that will showing the error messages. Write some styles and make it look awesome !

<div class="error-messages" style="display:none;"></div>

After the form sending, and checking errors, write this.

$(".error-messages").text("Some error").fadeIn();

Or you can make it empty and hide it, after a seconds or after user focus.

$(".error-messages").empty().fadeOut();
Answer from m1k1o on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_output.asp
JavaScript Output
Changing the innerHTML property of an HTML element is the most common way to display data in HTML.
๐ŸŒ
TutorialsTeacher
tutorialsteacher.com โ€บ javascript โ€บ display-popup-message-in-javascript
JavaScript Message Boxes: alert(), confirm(), prompt()
The alert() function displays a message to the user to display some information to users. This alert box will have the OK button to close the alert box. ... The alert() function takes a paramter of any type e.g., string, number, boolean etc.
Discussions

javascript - Show message instead of alert - Stack Overflow
Add hidden div aligned with your elements and show the message on hidden div's instead of alert box. ... As mentioned in other answers, you have to work with the DOM. If you have the time, however, I would advice you advice you to not simply copy/paste a line of jquery but to look into what the DOM actually is and how to manipulate it in pure javascript... More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - How to display messages before executing - Stack Overflow
In my javascript project, there are some functions, which take a while to run. I want to display "something" to the user, that his/hers process has already started. When I try the usual More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - How do I display a alert on a website? - Stack Overflow
I do not want it be link soandso.com says: then the message. I wanted something just like the picture shows. L. Cavinder โ€“ L. Cavinder ยท 2018-01-05 03:43:40 +00:00 Commented Jan 5, 2018 at 3:43 ... It looks like you have tagged 'javascript' on this question, so I will show you the most common way to do it completely using javascript. Use the alert() function. The alert function takes one parameter โ€” the text that you want to show. All browsers will present this in ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - Display a message based on variable value - Stack Overflow
I have a JavaScript function in a html page that returns a variable x. Based on the value of x i want to display a message in the page. if x has a value before 10 seconds have passed -> message:... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Team Treehouse
teamtreehouse.com โ€บ library โ€บ javascript-basics โ€บ display-messages-with-javascript
Display Messages with JavaScript (How To) | JavaScript Basics | Treehouse
in a period, JavaScript statements end in a ;. 3:27 ยท You write programs by typing multiple statements, 3:31 ยท just like you write a paragraph by writing multiple sentences. 3:34 ... Pressing Enter displays the message.
Published ย  February 18, 2020
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ met_win_alert.asp
Window alert() Method
The alert() method displays an alert box with a message and an OK button. The alert() method is used when you want information to come through to the user.
๐ŸŒ
Code Boxx
code-boxx.com โ€บ home โ€บ 6 ways to display messages in html javascript (simple examples)
6 Ways To Display Messages In HTML Javascript (Simple Examples)
July 2, 2023 - For you guys who have not heard, this is where Javascript outputs all error messages, and whatever you donโ€™t want the users to see. Press F12 to open the developerโ€™s console in most modern browsers. console.log() Will show a message in the developerโ€™s console.
๐ŸŒ
University of Washington
washington.edu โ€บ accesscomputing โ€บ webd2 โ€บ student โ€บ unit5 โ€บ module2 โ€บ lesson1.html
Lesson 1: Using JavaScript to Show an Alert
In PHP, variable names must start with a $, but that isn't the case in JavaScript. Take a look at the following example, which uses a variable named myText to customize the text that's displayed in the alert box. <script> function showAlert() { var myText = "This can be whatever text you like!"; alert (myText); } </script> Try modifying your showAlert() script with your own custom alert message.
Find elsewhere
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 70006301 โ€บ how-to-display-messages-before-executing
javascript - How to display messages before executing - Stack Overflow
You have to give the browser a chance to update the display before you start the work: show_message("starting"); setTimeout(() => { this_function_takes_forever(); show_message("done"); }, 100);
๐ŸŒ
SheCodes
shecodes.io โ€บ athena โ€บ 12892-how-to-display-an-alert-message-in-javascript
[JavaScript] - How to display an alert message in | SheCodes
Learn how to use the alert() function to display pop-up messages in JavaScript with this simple example code snippet.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_popup.asp
JavaScript Popup Boxes
To display line breaks inside a popup box, use a back-slash followed by the character n. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com ยท If you want to report ...
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 48105950 โ€บ how-do-i-display-a-alert-on-a-website
javascript - How do I display a alert on a website? - Stack Overflow
<script type="text/javascript"> alert('My message goes here'); </script> If you want to change the way this looks, you will have to use an HTML modal. By using that, you can customize the HTML&CSS to look exactly like the picture you attached.
Top answer
1 of 2
1

Use setTimeout, when you click button I stop interval and timer function because it is success, and when button isn't clicked and if x variable isn't y timer and interval continues countDown, I used setInterval for understanding how it works, also I edited code , I might this is what you want

const input = document.querySelector("input")
const button = document.querySelector("button")
const textTimer = document.querySelector("p")

let number = 10

let x = ""

textTimer.innerHTML = number


button.addEventListener("click", ()=> {
   x = input.value
   
   if(x === "y"){
    alert("success")
    clearTimeout(timer)
    clearInterval(interval)
  }
  
  console.log(x)
})

const interval = setInterval(()=> {
  number--
  textTimer.innerHTML = number

  if(number <= 0){
    clearInterval(interval)
  }
}, 1000)

const timer = setTimeout(()=> {
    if(x.length > 0){
    alert("Success")
  } else {
     alert("There is a problem")
  }
}, 10000)
<input type="text">
<button>Insert Value in x</button>

<p></p>

2 of 2
0

The solution is .setTimeout() which allows you to run the function, command ... after an estimated time.

/*

// ES6

const checkVal = () => {

  const input = document.querySelector('input').value;
  
  // Ternary Operator
  input === 'yes' ? alert('yes') : alert('no');
};

*/

function checkVal() {

  const input = document.querySelector('input').value;
  
  if(input.toLowerCase() === 'yes') {
    alert('yes')
  } else {
    alert('no')
  };
  
};


// 2000 means 2k miliseconds, if you want to set it on 10 seconds, then 10000

document.querySelector('button').addEventListener('click', () => {
  setTimeout(checkVal
    , 2000
  )}
);
<p>If you type *yes*, it will alert yes. But if you type anything else(not yes) it will show *no*.</p>
<input type='text'>
<button type='text'>Click</button>

๐ŸŒ
SheCodes
shecodes.io โ€บ athena โ€บ 52159-how-to-display-a-message-box-in-javascript-using-alert
[JavaScript] - How to display a message box in JavaScript using alert()
Learn how to display a message box in a browser using the alert() method in JavaScript, and also how to use JOptionPane to display a message box in Java programs.
๐ŸŒ
EDUCBA
educba.com โ€บ home โ€บ software development โ€บ software development tutorials โ€บ javascript tutorial โ€บ javascript message box
JavaScript Message Box | How Does Message Box Work in JavaScript?
April 1, 2023 - JavaScript Message Box is nothing but the alert box which is used to show message along with the Ok button. Those type of message box helps users to distract user from the current window and it forces user to read text or message from the message ...
Call ย  +917738666252
Address ย  Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
๐ŸŒ
Altcademy
altcademy.com โ€บ blog โ€บ how-to-display-text-in-javascript
How to display text in JavaScript - Altcademy.com
August 28, 2023 - Imagine you're learning a new language and you want to say hello to someone. The first thing you might learn is how to say "hello". Similarly, when you're learning JavaScript, one of the first things you might want to do is display some text. In JavaScript, we usually do this with a command called console.log.
๐ŸŒ
O'Reilly
oreilly.com โ€บ library โ€บ view โ€บ javascript-the-definitive โ€บ 0596101996 โ€บ re476.html
Window.alert( ): display a message in a dialog box โ€” JavaScript 1.0: - JavaScript: The Definitive Guide, 5th Edition [Book]
August 17, 2006 - 23.1. Scripting Applets23.2. Scripting ... to display in a dialog box popped up over window. The alert( ) method displays the specified message to the user in a dialog box....
Author ย  David Flanagan
Published ย  2006
Pages ย  1018
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-display-error-without-alert-box-using-javascript
How to display error without alert box using JavaScript ? - GeeksforGeeks
September 24, 2024 - Table of Content Using a Custom ... with React Bootstrap ? In React Bootstrap, an `Alert` is a component used to display various types of messages or notifications to users....