If you don't care much about layout of this pop-Up, just use window.confirm()

You can build this into your HTML form like this:

<html>
  <script>
    function checkForm() {
      var message = "You entered following data:\n" + 
        "Car name: " + document.getElementById('cn').value + "\n" +
        "Car color: " + document.getElementById('cc').value + "\n" + 
        "Is this correct?";
      if (window.confirm(message))
        document.getElementById("carform").submit();
    }

  </script>


  <form id="carform" target="...">
    Car name: <input type="text" name="carname" id="cn"/><br/>
    Car color: <input type="text" name="carcolor" id="cc"/><br/>
    <input type="button" value="submit" onclick="checkForm()"/>
  </form>

</html>

EDIT To compare the entered values to the ones you have stored in your SQL database, you have to use PHP. You could realize it for example like this:

<html>
  <script>
    function checkForm() {
      <?php
        //Query the current databse values and store them for example in $carcolor $carname
        echo 'var currentCarName = "' . $carname . '"';
        echo 'var currentCarColor = "' . $carcolor . '"';

      ?>
      var message = "You entered following data:\n" + 
        "Car name: "    + document.getElementById('cn').value + "\n" +
        "  Old name: "  + currentCarName + "\n" +
        "Car color: "   + document.getElementById('cc').value + "\n" + 
        "  Old color: " + currentCarColor + "\n" +
        "Is this correct?";
      if (window.confirm(message))
        document.getElementById("carform").submit();
    }

  </script>


  <form id="carform" target="...">
    Car name: <input type="text" name="carname" id="cn"/><br/>
    Car color: <input type="text" name="carcolor" id="cc"/><br/>
    <input type="button" value="submit" onclick="checkForm()"/>
  </form>

</html>
Answer from lSoleyl on Stack Overflow
🌐
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 ...
🌐
W3Schools
w3schools.com β€Ί howto β€Ί howto_js_popup.asp
How To Create Popups
Fullscreen Video Modal Boxes Delete Modal Timeline Scroll Indicator Progress Bars Skill Bar Range Sliders Color Picker Email Field Tooltips Display Element Hover Popups Collapsible Calendar HTML Includes To Do List Loaders Badges Star Rating User Rating Overlay Effect Contact Chips Cards Flip Card Profile Card Product Card Alerts Callout Notes Labels Ribbon Tag Cloud Circles Style HR Coupon List Group List Group with Badges List Without Bullets Responsive Text Cutout Text Glowing Text Fixed Footer Sticky Element Equal Height Clearfix Responsive Floats Snackbar Fullscreen Window Scroll Drawing
People also ask

What is the HTML tag for popups?
HTML does not have a specific tag for popups. Instead, popups are typically created using a combination of elements, which are styled and manipulated with CSS and JavaScript. The popup content is hidden initially and displayed when triggered by an event, such as clicking a button.
🌐
elfsight.com
elfsight.com β€Ί blog β€Ί how-to-make-a-popup-in-html
How to Make a Popup in HTML: Two Simple Solutions
How to create a popup in HTML with CSS?
To create a popup in HTML with CSS, use a hidden element that contains the popup content and apply styles for the popup's appearance, such as background color, borders, padding, and position (usually fixed or absolute). CSS animations can be used to add effects like fading or sliding. JavaScript is used to display the popup by changing the visibility or display property of the when triggered.
🌐
elfsight.com
elfsight.com β€Ί blog β€Ί how-to-make-a-popup-in-html
How to Make a Popup in HTML: Two Simple Solutions
How to make a popup card in HTML?
A popup card can be made using a element styled with CSS to appear like a card. You can create the popup card with a specific width, height, and padding to look like a modal or a dialog box. To show the popup card, you'll need to use JavaScript to toggle its visibility when a trigger, like a button click, occurs.
🌐
elfsight.com
elfsight.com β€Ί blog β€Ί how-to-make-a-popup-in-html
How to Make a Popup in HTML: Two Simple Solutions
🌐
W3Schools
w3schools.com β€Ί howto β€Ί howto_js_alert.asp
How To Create an Alert Message Box
If you want the ability to close the alert message, add a <span> element with an onclick attribute that says "when you click on me, hide my parent element" - which is the container <div> (class="alert"). Tip: Use the HTML entity "&times;" to create the letter "x".
🌐
Picreel
picreel.com β€Ί home β€Ί blog β€Ί popup implementation β€Ί html popup message: quick methods with codes & steps
HTML Popup Message Guide: HTML, CSS, and JavaScript (+Hack)
October 14, 2025 - HTML popup message explained: Step-by-step HTML, CSS & JavaScript guide with detailed codes. Plus an easy no-code option to design popups that convert better.
Top answer
1 of 2
1

If you don't care much about layout of this pop-Up, just use window.confirm()

You can build this into your HTML form like this:

<html>
  <script>
    function checkForm() {
      var message = "You entered following data:\n" + 
        "Car name: " + document.getElementById('cn').value + "\n" +
        "Car color: " + document.getElementById('cc').value + "\n" + 
        "Is this correct?";
      if (window.confirm(message))
        document.getElementById("carform").submit();
    }

  </script>


  <form id="carform" target="...">
    Car name: <input type="text" name="carname" id="cn"/><br/>
    Car color: <input type="text" name="carcolor" id="cc"/><br/>
    <input type="button" value="submit" onclick="checkForm()"/>
  </form>

</html>

EDIT To compare the entered values to the ones you have stored in your SQL database, you have to use PHP. You could realize it for example like this:

<html>
  <script>
    function checkForm() {
      <?php
        //Query the current databse values and store them for example in $carcolor $carname
        echo 'var currentCarName = "' . $carname . '"';
        echo 'var currentCarColor = "' . $carcolor . '"';

      ?>
      var message = "You entered following data:\n" + 
        "Car name: "    + document.getElementById('cn').value + "\n" +
        "  Old name: "  + currentCarName + "\n" +
        "Car color: "   + document.getElementById('cc').value + "\n" + 
        "  Old color: " + currentCarColor + "\n" +
        "Is this correct?";
      if (window.confirm(message))
        document.getElementById("carform").submit();
    }

  </script>


  <form id="carform" target="...">
    Car name: <input type="text" name="carname" id="cn"/><br/>
    Car color: <input type="text" name="carcolor" id="cc"/><br/>
    <input type="button" value="submit" onclick="checkForm()"/>
  </form>

</html>
2 of 2
0

There's no native function for making a pop up message show up loading HTML. However there is FancyBox which does exactly this.

http://fancybox.net/

Look at this question and this blog for more information on how to do this

🌐
GeeksforGeeks
geeksforgeeks.org β€Ί html β€Ί how-to-create-popup-box-using-html-and-css
How to Create Popup Box using HTML and CSS? - GeeksforGeeks
This method toggles the popup's visibility by changing its CSS display property. ... <html> <head> <style> .popup { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); justify-content: center; align-items: center; } .popup-content { background: #fff; padding: 20px; border-radius: 5px; text-align: center; } .popup:target { display: flex; } </style> </head> <body> <a href="#popup" style="padding: 10px 20px; background-color: #007BFF; color: #fff; text-decoration: none; border-radius: 5px;">Open Popup</a> <div id="popup" class="popup"> <div class="popup-content"> <h2>Popup Title</h2> <p>This is a simple popup box.</p> <a href="#" style="display: inline-block; margin-top: 10px; padding: 5px 10px; background-color: #dc3545; color: #fff; text-decoration: none; border-radius: 3px;">Close</a> </div> </div> </body> </html>
Published Β  July 23, 2025
Find elsewhere
🌐
The HTML Shark
html-shark.com β€Ί JavaScripts β€Ί PopupBox.htm
Popup boxes using alert(), confirm() and prompt() | The HTML Shark
Alert boxes are popup-messages, where you can only click OK, when you have read it. The syntax is window.alert(), or just alert().
🌐
Codedamn
codedamn.com β€Ί news β€Ί frontend
How to display HTML popup message using JavaScript?
October 4, 2022 - This article covered the HTML popup message we may make using JavaScript: Alert, Confirm, and Prompt.
🌐
Elfsight
elfsight.com β€Ί blog β€Ί how-to-make-a-popup-in-html
How to Make a Popup in HTML: Two Simple Solutions
December 3, 2025 - Here’s what you can customize in this HTML popup code to better fit your needs: ... Text. Update the content inside the <span> tag with any message or information you’d like to display.
🌐
Mobiscroll
demo.mobiscroll.com β€Ί javascript β€Ί popup
Javascript Popup Examples | Mobiscroll
3 weeks ago - Pop-over examples with customizable content, button configuration and behavior. For vanilla JS to use everywhere. Last update: Feb 24, 2026
🌐
WisePops
wisepops.com β€Ί blog β€Ί html-popup
How to Create an HTML Popup [CSS, Javascript]
The final version of this popup window will look like this: Define an HTML container for the popup and include elements like content, close button, and overlay (see the code below)
🌐
Popupsmart Community
community.popupsmart.com β€Ί installation & integration
How to make a popup in HTML? Different methods - Installation & Integration - Popupsmart Community
November 1, 2024 - Hey everyone! I’m trying to add a popup to my website to capture emails and promote discounts. I’d prefer a straightforward way to do it with HTML. So, how to make a popup in html? Can anyone share some methods?
🌐
Spiceworks
community.spiceworks.com β€Ί programming & development
HTML Code for Pop-up message - Programming & Development - Spiceworks Community
March 19, 2010 - I work in a Credit Union and I have been asked to redesign the website. I am using FrontPage. I need the code to create a popup message. We have to have a warning message popup when a link is clicked to leave our site. I used the β€œbehaviors” option in FrontPage, but it will only work if ...
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί javascript β€Ί what-are-the-types-of-popup-box-available-in-javascript
What are the types of Popup box available in JavaScript ? - GeeksforGeeks
August 5, 2025 - An alert box in JavaScript is a popup window that displays a simple message to the user. It is triggered by the alert() function and pauses code execution until the user clicks the "OK" button to close it.
🌐
MDN Web Docs
developer.mozilla.org β€Ί en-US β€Ί docs β€Ί Web β€Ί HTML β€Ί Reference β€Ί Elements β€Ί dialog
<dialog>: The Dialog element - HTML | MDN
3 weeks ago - The <dialog> HTML element represents a modal or non-modal dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.
🌐
CodeMyUI
codemyui.com β€Ί home β€Ί pop up
13 Alert / Pop Up Design Inspiration - HTML & CSS Snippets Ξ ℂ𝕠𝕕𝕖𝕄π•ͺπ•Œπ•€
Here is a really cool retro dialog box popup designed by rΓ©mi and coded by Thibaud Goiffon.... Read More ... When you want to add some short messages via a modal window this handy script by Samuel Janes might...
🌐
Claspo
claspo.io β€Ί blog β€Ί how to create a pop-up in html for your website
Create Popups in HTML β€” Claspo Guide β€” Claspo.io
July 21, 2025 - JavaScript is used to bring the popup screen in HTML to life by controlling its behavior. Here’s what the basic functions do: 1. Get pop-up element: selects the pop-up element by its ID. ... Using JavaScript, you can control when and where your popup appears β€” such as on specific pages like your pricing, blog, or checkout. This ensures your message is relevant and well-timed, rather than disruptive.
🌐
User.com
docs.user.com β€Ί how-to-create-pop-ups-with-a-thank-you-message
How to create pop-ups with a "Thank you" message | User.com Documentation
<script> var popupForm = document.querySelector("form"); var popupButton = popupForm.querySelector("button"); popupButton.addEventListener('click', function (e) { e.preventDefault(); var popupEmail = popupForm.querySelector("#email").value; var popupName = popupForm.querySelector("#first_name").value; var event_data = { event_name: "popup_sent", email: popupEmail, name: popupName } window.top.UE.pageHit({'apiKey':put_api_key_of_your_app_here, 'email': popupEmail, 'name': popupName, 'event': event_data }); document.getElementById('my_form').style.display = 'none'; document.getElementById('thank_you').style.display = 'block'; }); </script> Feel free to copy and adjust this code to suit your specific form and design requirements. This simple implementation provides a smooth and visually appealing way to acknowledge user submissions with a pop-up "Thank You" message.