Simple Popup with jQuery

A Popup box is used when you want to display small text, photos, maps or other content in a website. Popup is similar to dialogs. These are often generated by websites that include pop-up advertisements.  Creating Popups using jQuery is simple, which can be done using the following steps.

To create a popup, Add data-rel=”popup” and  data-role=”popup” attribute to <a>tag. Then give an id for <div>, and set the href of <a> to match the specified id.

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>

<div data-role="page">
  <div data-role="header">
    <h1>Welcome to My Site</h1>

  <div data-role="main" class="ui-content">
    <a href="#myPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all">View Popup</a>

    <div data-role="popup" id="myPopup" class="ui-content">
      <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-left">Close</a>
      <p>This is a Simple PopUp Box!!!</p>

  <div data-role="footer">




Morbits is One of the biggest and Proven Digital Marketing and Inbound Marketing Company from Kochi,Kerala. We undertake Web Development , Ecommerce , Mobile Apps, SEO, Server solutions , SMS,Newsletters, ORM and More since 2008

Leave a Reply

Your email address will not be published. Required fields are marked *