Call div in another page as inside a dialog box <p>I have developed a website using a template. There, a dialog box is prompt properly when click on a tag. But I need to call the dialog box div which is in another different page. Because I need to get a id which is passing from the URL to use with the GET['id'] with PHP. I have tried calling the div in this way</p> <pre><code> &lt;a href="x.html#myModal2"&gt;Alert&lt;/a&gt; </code></pre> <p>But its not working. Any one can give me a suggestion or a guidance to achieve my objective?</p> <p>here is my calling tag and the dialog box div</p> <pre><code> &lt;a href="#myModal2" role="button" class="btn btn-danger" data-toggle="modal"&gt;Alert&lt;/a&gt; &lt;div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt; &lt;h3 id="myModalLabel2"&gt;Alert Header&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Body goes here...&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button data-dismiss="modal" class="btn green"&gt;OK&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>here is the same div which I need to call in the x.html page</p> <pre><code>&lt;div id="myModal1" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt; &lt;h3 id="myModalLabel1"&gt;Modal Header&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Body goes here...&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Close&lt;/button&gt; &lt;button class="btn yellow"&gt;Save&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>