How to add modal popup in PHP using jQuery?

AuthorHariom Prajapati

Pubish Date19 Jun 2022

categoryJQuery

In this tutorial we will see that how to add modal popup in PHP using jQuery. Here we will use jQuery-ui.js library.

Let's see the example to add jQuery modal in PHP. 

 

Add jQuery Modal popup in PHP

<html lang="en">

<head>
    <title>How to add modal popup in PHP using jQuery</title>  
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
    <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <style type="text/css">
    #dialog{
        display: none;
    }
    </style>
</head>

<body>
<button>Click Here To Open Popup</button>
<div id="dialog" title="teknowize.com">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

<script type="text/javascript">
    $("button").click(function(){
        $( "#dialog" ).dialog();
    });
</script>

</body>
</html>

 

Output

php

Comments 0

Leave a comment