🌐
CodePen
codepen.io › Asadabbas › pen › pLMNGZ
Simple Popup [HTML + CSS + JS]
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
🌐
CodePen
codepen.io › nitoool › pen › ZKodWr
Onclick popup
Minimize JavaScript Editor · Fold ... anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } !...
🌐
CodePen
codepen.io › Shaz3e › pen › jEZpJW
Responsive Popup with JavaScript
<h1 class="s3-center">Responsive Popup with Javascript</h1> <p class="s3-center">Read the complete article tutorial <a href="http://blog.shaz3e.com/responsive-popup-with-javascript/">here</a>.</p> <!-- Overlay --> <div class="overlay" id="overlay" style="display:none;"></div> <!-- Popup --> <div class="popup" id="popup" style="display:none;"> <div class="popup-inner"> <input type="button" name="Close" class="s3-btn-close" onclick="popupClose();" value="&times;"> <h2>This is popup</h2> <p>Hey I am a popup overlay working with JavaScript</p> </div> </div> <!-- Popup Button --> <input type="button" class="s3-btn" name="Open" onclick="popupOpen();" value="Click to Show Overlay">
🌐
CodePen
codepen.io › marine-fraysse › pen › eYmBEvQ
Pop-up on Button Click
Button which brings up a pop-up overlay when clicked....
🌐
CodePen
codepen.io › asiburcodedrop › pen › PozrEby
Custom Popup Using Vanilla JavaScript
const clickBtn = document.getElementById("clickBtn"); const popup = document.getElementById("popup"); const closeBtn = document.getElementById("closeBtn"); clickBtn.addEventListener('click', ()=>{ popup.style.display = 'block'; }); closeBtn.addEventListener('click', ()=>{ popup.style.display = 'none'; }); popup.addEventListener('click', ()=>{ popup.style.display = 'none'; });
🌐
CodePen
codepen.io › imprakash › pen › GgNMXO
Pure css popup box
You can use the URL of any other Pen and it will include the JavaScript from that Pen.
🌐
CodePen
codepen.io › tag › simple popup
Pens tagged 'simple popup' on CodePen
CodePen doesn't work very well without JavaScript · We're all for progressive enhancement, but CodePen is a bit unique in that it's all about writing and showing front end code, including JavaScript. It's required to use most of the features of CodePen · Need to know how to enable it?
🌐
CodePen
codepen.io › kaleem78 › pen › NJxjVJ
show and hide popup on click
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
🌐
CodePen
codepen.io › ZlatinaNyagolova › pen › LZOgzZ
SImple Popup Div (on button and on link)
Minimize JavaScript Editor · Fold All · Unfold All · // When the user clicks on the button, // toggle between hiding and showing the dropdown content function showPopup() { event.preventDefault(); document.getElementById("popup_content").classList.toggle("show"); return false; } // Close the dropdown if the user clicks outside of it window.onclick = function(event) { if (!event.target.matches('.thePopup')) { var dropdowns = document.getElementsByClassName("popup_content"); var i; for (i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains('show')) { openDropdown.classList.remove('show'); } } } } !
Find elsewhere
🌐
JavaScript.info
javascript.info › tutorial › frames and windows
Popups and window methods
A name of the new window. Each window has a window.name, and here we can specify which window to use for the popup. If there’s already a window with such name – the given URL opens in it, otherwise a new window is opened.
🌐
CodePen
codepen.io › the_sandiva › pen › MNaaLN
PopUp Window Vanilla JS
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
🌐
CodePen
codepen.io › khaag › pen › ZEwKPj
Modal Popup Window
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
🌐
CodePen
codepen.io › si-hamada › pen › QGQOrB
PopUp for every Button
$(document).ready(function(){ $('.popUpBtn').on('click', function(){ $('#'+$(this).data('modal')).css('display','block'); }) $('span.close').on('click', function(){ $('.modal').css('display','none'); }) $(window).on('click', function(event){ if (jQuery.inArray( event.target, $('.modal') ) != "-1") { $('.modal').css('display','none'); } }) }) // Get the modal // var modal = document.getElementById('myModal'); // Get the button that opens the modal // var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal // var span = document.getElementsByClassName("close")
🌐
Stack Overflow
stackoverflow.com › questions › 75440724 › popup-not-working-in-browser-but-works-in-codepen
javascript - Popup not working in browser but works in codepen - Stack Overflow
I turned off popup blockers as well and thought that would help but still nothing shows up · document.addEventListener("DOMContentLoaded", function() { var ebModal = document.getElementById("mySizeChartModal"); var ebBtn = document.getElementById("mySizeChart"); var ebSpan = document.getElementsByClassName("ebcf_close")[0]; ebBtn.onclick = function() { ebModal.style.display = "block"; }; ebSpan.onclick = function() { ebModal.style.display = "none"; }; window.onclick = function(event) { if (event.target == ebModal) { ebModal.style.display = "none"; } }; });
🌐
CodePen
codepen.io › blayderunner123-the-reactor › pen › vYBVaRW
Button Popup Window onClick
An online code editor, learning environment, and community for front-end web development using HTML, CSS and JavaScript code snippets, projects, and web applications.
🌐
CodePen
codepen.io › abbassac › pen › YdPKyM
Open Popup Window
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
🌐
CodePen
codepen.io › xSobeKx › pen › wvBzoPb
Display a popup on click
When a user clicks a symbol, show a [`Popup`](/mapbox-gl-js/api/#popup) containing more information. The symbols are from the [Maki](https://labs.mapbo...
🌐
CodePen
codepen.io › mahiwebs › pen › gOPXYKp
Simple popup box
Minimize JavaScript Editor · Fold All · Unfold All · //Building Popup const button = document.querySelector('button'); const popup = document.querySelector('.popup-window'); const close = document.querySelector('.close-menu'); button.addEventListener('click', () => { popup.style.display = 'block'; }); close.addEventListener('click', () => { popup.style.display = 'none'; }); popup.addEventListener('dblclick', () => { popup.style.display = 'none'; }); !
🌐
CodePen
codepen.io › BadPinkChicken › pen › XXxVPX
Popup onclick
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.