Please try jQuery UI dialog

Here is the forms demo

For mobile use, have a look at jQuery Mobile - Creating dialogs

Answer from mplungjan on Stack Overflow
🌐
W3Schools
w3schools.com › howto › howto_js_popup_form.asp
How To Create a Popup Form With CSS
Google Charts Google Fonts Google ... ... Learn how to create a popup form with CSS and JavaScript. ... Use a <form> element to process the input....
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-create-a-popup-form-using-html-css-and-javascript
How to create a Popup Form using HTML CSS and JavaScript ? - GeeksforGeeks
Create the basic HTML structure with a button to trigger the popup and a hidden overlay containing the form. Style the overlay and form using CSS, ensuring a visually appealing and responsive design.
Published   July 23, 2025
People also ask

What Is a Popup Form?
A popup form is an overlay that appears on a web page to collect visitor information, typically an email address, phone number, or feedback. Unlike embedded inline forms that sit within the page content, popup forms display on top of the page and demand attention. They can trigger based on time delays, scroll depth, exit intent, or button clicks.
🌐
popupsmart.com
popupsmart.com › popupsmart conversion rate optimization & digital marketing blog › how to create popup forms in 2026 (free guide)
How to Create Popup Forms in 2026 (Free Guide)
How Do You Create a Popup Form?
Sign up for a no-code popup builder like Popupsmart, choose a template, customize the design and form fields, set targeting rules (which pages, what trigger), connect your email platform, and publish. The whole process takes 10-15 minutes. No coding required. If you prefer coding, you can also build a popup form with HTML, CSS, and JavaScript using a W3Schools popup form tutorial, though a no-code builder is faster for most teams.
🌐
popupsmart.com
popupsmart.com › popupsmart conversion rate optimization & digital marketing blog › how to create popup forms in 2026 (free guide)
How to Create Popup Forms in 2026 (Free Guide)
How Do You Create a Popup Form in WordPress?
The simplest way is to use Popupsmart's WordPress integration. Install the one-line JavaScript snippet in your theme's header (via Appearance &gt; Theme File Editor &gt; header.php or a plugin like Insert Headers and Footers), then build your popup in Popupsmart's dashboard. The popup will appear on your WordPress site based on your targeting rules. For a Wix site instead, see our guide on how to create a popup in Wix. You can also follow our detailed walkthrough on how to create popup ads in 7 steps.
🌐
popupsmart.com
popupsmart.com › popupsmart conversion rate optimization & digital marketing blog › how to create popup forms in 2026 (free guide)
How to Create Popup Forms in 2026 (Free Guide)
🌐
WisePops
wisepops.com › blog › html-popup
How to Create an HTML Popup [CSS, Javascript]
const popupOverlay = document.getElementById('popupOverlay'); ... Oleksii Kovalenko is a digital marketing expert and a writer with a degree in international marketing. He has seven years of experience helping ecommerce store owners promote their businesses by writing detailed, in-depth guides. ... Learn how to create a convincing newsletter signup form.
🌐
W3Schools
w3schools.com › howto › howto_js_popup.asp
How To Create Popups
Login Form Signup Form Checkout Form Contact Form Social Login Form Register Form Form with Icons Newsletter Stacked Form Responsive Form Popup Form Inline Form Clear Input Field Hide Number Arrows Copy Text to Clipboard Animated Search Search Button Fullscreen Search Input Field in Navbar Login Form in Navbar Custom Checkbox/Radio Custom Select Toggle Switch Check Checkbox Detect Caps Lock Trigger Button on Enter Password Validation Toggle Password Visibility Multiple Step Form Autocomplete Turn off autocomplete Turn off spellcheck File Upload Button Empty Input Validation · Filter List Filt
🌐
W3docs
w3docs.com › javascript
How to Create a Popup Form Using JavaScript
Read this JavaScript tutorial and learn how to create popup login, contact, multiple popup logins in one page and other forms on your website with examples.
🌐
Elfsight
elfsight.com › online-form-builder › templates › html-popup-forms
HTML Popup Forms widget - Create Popup Forms templates for HTML
June 25, 2024 - Create a form to allow user registration in pop-ups using the template for website. ... Create your form with Elfsight AI by describing your requirements in plain language, or build your own form using our form builder. ... If you’re on the hunt for a highly responsive and flexible form to boost engagement rate and get more potential clients to your HTML, then the Popup Forms widget from Elfsight is the best choice to set your brand apart.
Find elsewhere
🌐
Reddit
reddit.com › r/webdev › best method to create a popup login form?
r/webdev on Reddit: Best method to create a popup login form?
March 28, 2023 -

Hey everyone, I'm creating my very first CRUD app! HTML, CSS, JS and Express with ejs.

I want to create a popup login/sign up form, similar to the one on Twitter, and I was wondering what the best way to go about this was:

Shall I write all the html, hide it and add an event to the button which toggles the class that makes the overlay and form appear? Or

Just write the container in html, and add an event to the button which fires a function that creates all the elements and appends them? (no inner html)

I was considering the second option, because this form is going to be in different places (home page CTA, show page and index page of someone isn't signed in, etc), so I was thinking that having a function build it out would be more functional (pun not intended) but I've been hearing that using js to create html should be kept to a bare minimum, so I'm curious to hear some more expert opinions.

🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-create-popup-box-using-html-and-css
How to Create Popup Box using HTML and CSS? - GeeksforGeeks
This approach uses JavaScript to dynamically show and hide the popup based on user interactions. ... <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; } </style> </head> <body> <button id="openPopup" style="padding: 10px 20px; background-color: #28a745; color: #fff; border: none; border-radius: 5px;">Open Popup</button> <div id="popup" class="popup"> <div class="popup-c
Published   July 23, 2025
🌐
PopupSmart
popupsmart.com › popupsmart conversion rate optimization & digital marketing blog › how to create popup forms in 2026 (free guide)
How to Create Popup Forms in 2026 (Free Guide)
1 week ago - Sign up for a no-code popup builder like Popupsmart, choose a template, customize the design and form fields, set targeting rules (which pages, what trigger), connect your email platform, and publish. The whole process takes 10-15 minutes. No coding required. If you prefer coding, you can also build a popup form with HTML, CSS, and JavaScript using a W3Schools popup form tutorial, though a no-code builder is faster for most teams.
🌐
WisePops
wisepops.com › blog › popup-forms
Popup Forms: How to Create Easily [+Examples]
Unlike many popup forms we see, this one appears in the right bottom corner of the screen. Once again, the lightbox effect is used to focus our attention on the message. This time, the text is even shorter, containing only the call to action with the benefits of signing up.
🌐
Foolishdeveloper
foolishdeveloper.com › popup-registration-form-in-html-css-code-demo
Popup Registration Form in HTML CSS (Code + Demo)
February 11, 2024 - A popup form is a javascript form ... user can use the services of the user. A pop-up form is a button event that triggers a function that pops up the form for the user....
🌐
Elfsight
elfsight.com › blog › how-to-make-a-popup-in-html
How to Make a Popup in HTML: Two Simple Solutions
December 3, 2025 - The simplest approach to create an HTML notification popup is to use the Elfsight’s widget. This versatile solution works seamlessly with nearly all website builders and can be added to your site in just a few minutes. Here’s how you can effortlessly add a popup to your website using this widget: Launch the popup editor and choose a pre-designed template or create your own custom popup. Personalize the settings and design: add and remove elements, update colors, and adjust the layout to match your site’s branding.
🌐
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 - Next, just paste the code before the closing </head> tag in your website’s HTML file. This will show your Picreel popup on your website exactly where you want it! After launch, check the Picreel popup analytics dashboard for views, CTR, ...
🌐
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?
🌐
SheCodes
shecodes.io › athena › 261892-how-to-make-a-popup-login-form-with-html-css-and-javascript
[HTML] - How to Make a Popup Login Form with HTML, CSS, and | SheCodes
Fall In Love With Coding Sale 🎉 30% off on all coding workshops ending on February 16th Ending in 6 days Get Deal Get This Deal NOW ... Learn how to create a popup login form using HTML, CSS, and JavaScript, with step-by-step instructions and code examples.
🌐
Google Groups
groups.google.com › g › TiddlyWiki › c › dRh5z2pgYFA
How to Create a Popup Form
It will just show the HTML form with some CSS formatting and that's it. Styles in TW are defined using a tiddler named eg: `my-form-styles ` tagged: ` $:/tag/Stylesheet` PopUps can be defined using the reveal-widget using the type: popup
🌐
MailerLite
mailerlite.com › help › how-to-create-a-pop-up-form
How To Create A Pop-Up Form - MailerLite
February 16, 2024 - How to create a pop-up form How to use the pop-up form editor How to apply settings to a pop-up form How to hide/show pop-up forms on specific pages Pop-up on click event ... Customers with Paid plans can contact Support via their account. For Free plans, we recommend joining our Community where other MailerLiters love helping each other. Note: If you're a Classic user, please log in to your account to access the dedicated Classic Help Center.
Top answer
1 of 4
3

You can use jquery UI:

  $(function() {
    $("#dialog").dialog({
      autoOpen: false,
      show: {
        effect: "blind",
        duration: 1000
      },
      hide: {
        effect: "explode",
        duration: 1000
      }
    });

    $("#opener").click(function() {
      $("#dialog").dialog("open");
    });
  });
body {
  background: #a7a7a7;
}
.login__form {
  /*width: 320px;*/
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  border-top: 5px solid #ff4e50;
  margin: 0 auto;
}
.login__form fieldset {
  border: 0;
}
.login__form h3 {
  text-align: center;
  color: #666;
  font-size: 18px;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: bold;
  padding: 0;
  margin: 0;
  margin-bottom: 12px;
}
.login__form input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 20px;
  font-size: 14px;
  font-family: Montserrat;
  padding: 0 20px 0 50px;
  outline: none;
}
.login__form input#username {
  background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px top no-repeat;
  background-size: 16px 80px;
}
.login__form input#username:focus {
  background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px bottom no-repeat;
  background-size: 16px 80px;
}
.login__form input#password {
  background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px top no-repeat;
  background-size: 16px 80px;
}
.login__form input#password:focus {
  background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px bottom no-repeat;
  background-size: 16px 80px;
}
.login__form input:active,
.login__form input:focus {
  border: 1px solid #ff4e50;
}
.login__form input#button {
  width: 100%;
  height: 40px;
  background: #ff4e50;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #e15960;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 14px;
  font-family: Montserrat;
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.login__form input#button:hover {
  opacity: 0.7;
  filter: alpha(opacity=70);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div id="dialog">
  <form name="login" class="login__form">
    <h3>Login</h3>
    <fieldset>
      <input type="text" value="" placeholder="Username" id="username">
      <input type="password" value="" placeholder="Password" id="password">
      <input type="submit" value="Submit" id="button">
    </fieldset>
  </form>
</div>
<button id="opener">Log In</button>

Of course you can modify this code to align with your needs.

2 of 4
0

Hi now used to simple jquery code as like this

$(document).ready(function(){
    $('.login__form').hide();
    $('.click').on('click', function(){
      $('.login__form').show();
    });
  $('.closePopUP').on('click', function(){
     $('.login__form').hide();
  })
  
});
body {
    background: #a7a7a7;
}
.closePopUP{position: absolute;
right: 8px;
top: 7px;
cursor: pointer;
border: solid 2px red;
border-radius: 50%;
font-size: 14px;
font-family: arial;
padding: 2px 6px;}
.login__form {
	width: 320px;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    border-top: 5px solid #ff4e50;
    margin: 0 auto;position:relative;
}

.login__form fieldset{
	border: 0;
}

.login__form h3 {
    text-align: center;
    color: #666;
    font-size: 18px;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 20px;
	font-weight: bold;
    padding: 0;
    margin: 0;
    margin-bottom: 12px;
}

.login__form input {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: Montserrat;
    padding: 0 20px 0 50px;
    outline: none;
}

.login__form input#username {
    background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px top no-repeat;
    background-size: 16px 80px;
}

.login__form input#username:focus {
    background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px bottom no-repeat;
    background-size: 16px 80px;
}

.login__form input#password {
    background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px top no-repeat;
    background-size: 16px 80px;
}

.login__form input#password:focus {
    background: #fff url('http://i.imgur.com/Qf83FTt.png') 20px bottom no-repeat;
    background-size: 16px 80px;
}

.login__form input:active, .login__form input:focus {
    border: 1px solid #ff4e50;
}

.login__form input#button {
    width: 100%;
    height: 40px;
    background: #ff4e50;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #e15960;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    font-family: Montserrat;
    outline: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.login__form input#button:hover {
    opacity: 0.7;
    filter: alpha(opacity=70);
}
.click{float:left;cursor:pointer;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<button class="click">login popup</button>
<form name="login" class="login__form">
<span class="closePopUP">X</span>
			<h3>Login</h3>
			<fieldset>
				<input type="text" value="" placeholder="Username" id="username">
				<input type="password" value="" placeholder="Password" id="password">
				<input type="submit" value="Submit" id="button">
			</fieldset>
</form>