Simple Model Popup Box using HTML CSS and JavaScript

Today, We want to share with you Simple Model Popup Box using HTML CSS and JavaScript.In this post we will show you javascript popup window onclick example, hear for html code for popup window on page load we will give you demo and example for implement.In this post, we will learn about A Very Simple Popup Box – HTML, CSS, JavaScript with an example.

Simple Model Popup Box using HTML CSS and JavaScript

There are the Following The simple About Simple Popup or Model Box Using HTML CSS and JavaScript Full Information With Example and source code.

Read Also:  jquery validate select dropdown Example

As I will cover this Post with live Working example to develop how to create popup in html with css, so the How To Create a Modal Popup Box with CSS and JavaScript? is used for this example is following below.

The HTML Code

index.html

<a class="alert_model_popup_click">Click here to show the Model Popup</a>
<div class="backg_smooth_scrol">
<div>
<div class="removeHideBtnModel">×</div>
Add any Angularjs Vuejs or any tags for HTML Data content
inside the Model popup box!

</div>
</div>

The CSS Code

Pure added CSS

.backg_smooth_scrol{
background:rgba(0,0,0,.4);
cursor:pointer;
display:none;
height:100%;
position:fixed;
text-align:center;
top:0;
width:100%;
z-index:10000;
}
.backg_smooth_scrol .helper{
display:inline-block;
height:100%;
vertical-align:middle;
}
.backg_smooth_scrol > div {
background-color: #fff;
box-shadow: 10px 10px 60px #555;
display: inline-block;
height: auto;
max-width: 551px;
min-height: 100px;
vertical-align: middle;
width: 60%;
position: relative;
border-radius: 8px;
padding: 15px 5%;
}
.removeHideBtnModel {
background-color: #fff;
border: 3px solid #999;
border-radius: 50px;
cursor: pointer;
display: inline-block;
font-family: arial;
font-weight: bold;
position: absolute;
top: -20px;
right: -20px;
font-size: 25px;
line-height: 30px;
width: 30px;
height: 30px;
text-align: center;
}
.removeHideBtnModel:hover {
background-color: #ccc;
}
.alert_model_popup_click {
cursor: pointer;
font-size: 20px;
margin: 20px;
display: inline-block;
font-weight: bold;
}

The Script

using jquery Example

$(window).load(function () {
$(".alert_model_popup_click").click(function(){
$('.backg_smooth_scrol').show();
});
$('.backg_smooth_scrol').click(function(){
$('.backg_smooth_scrol').hide();
});
$('.removeHideBtnModel').click(function(){
$('.backg_smooth_scrol').hide();
});
});

Web Programming Tutorials Example with Demo

Read :

Read Also:  Laravel 5.7 database Multiple seeder Example

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about javascript popup window onclick.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  Image Overlay Hover Effects With CSS3 Transitions
  2. Read Also:  Add And Remove Text box Dynamically Using JavaScript Example
  3. Read Also:  laravel get all query string
  4. Read Also:  failed to load resource: the server responded with a status of 404 (not found)
  5. Read Also:  Creating jQuery Animation Effects using Inbuilt Methods
  6. Read Also:  Remove undefined value from jquery array
  7. Read Also:  Remove particular value from jquery Array
  8. Read Also:  WooCommerce Get Product General Info
  9. Read Also:  How to get the class name using Jquery Example with demo?
  10. Read Also:  How to add bootstrap accordion with plus minus Toggle Icons?
CLOSEX