Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a jQuery Dialog without a DIV

Is it possible to create a popup without being based on a div. Example, I have a the following DIV:

<div id="dialog" title="Info">
    <p>This is a test</p>
</div>

Instead of calling a dialog like this:

$("#dialog").dialog();

I would like to call like this:

 $("This is a test").dialog();

How would it be possible?

Thank you, Regards.

like image 567
Zakaria Avatar asked Aug 30 '10 09:08

Zakaria


1 Answers

You can call it like this:

 $("<div>This is a test</div>").dialog();
like image 83
Alex Reitbort Avatar answered Oct 12 '22 01:10

Alex Reitbort