Simple Modal and Javascript Call
<p>I created a Simply Modal popup dialog which works fine if you click on </p>

<pre><code>    &lt;a href='#' class='confirm'&gt;Demo&lt;/a&gt;
</code></pre>

<p>however how can I call this "confirm" css class from within Javascript. I have tried... </p>

<pre><code>    &lt;script language="JavaScript" type="text/JavaScript"&gt;
       $(".confirm").click();
       ** Also tried this to but no good... **
       document.getElementsByTagName('body')[0].className = 'confirm';
    &lt;/script&gt;
</code></pre>

<p>But didn't work. I'm sure this is pretty easy to do but can't seem to get it.</p>

<p>Thanks, </p>

<p>Frank G.</p>

<p><em><strong></em>**<em>*</em></strong> HERE IS THE SCRIPT I AM USING <strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>
         
        
        
         SimpleModal Confirm Modal Dialog 
        
        </p>

<pre><code>    &lt;!-- Page styles --&gt;
    &lt;link type='text/css' href='css/demo.css' rel='stylesheet' media='screen' /&gt;

    &lt;!-- Confirm CSS files --&gt;
    &lt;link type='text/css' href='css/confirm.css' rel='stylesheet' media='screen' /&gt;


    &lt;!-- JS files are loaded at the bottom of the page --&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;div id='container'&gt;
&lt;div id='logo'&gt;
    &lt;h1&gt;Simple&lt;span&gt;Modal&lt;/span&gt;&lt;/h1&gt;
    &lt;span class='title'&gt;A Modal Dialog Framework Plugin for jQuery&lt;/span&gt;
&lt;/div&gt;
&lt;div id='content'&gt;
    &lt;div id='confirm-dialog'&gt;
        &lt;h3&gt;Confirm Override&lt;/h3&gt;
        &lt;p&gt;A modal dialog override of the JavaScript confirm function. Demonstrates the use of the &lt;code&gt;onShow&lt;/code&gt; callback as well as how to display a modal dialog confirmation instead of the default JavaScript confirm dialog.&lt;/p&gt;
        &lt;input type='button' name='confirm' class='confirm' value='Demo'/&gt; or &lt;a href='#' class='confirm'&gt;Demo&lt;/a&gt;
    &lt;/div&gt;

    &lt;!-- modal content --&gt;
    &lt;div id='confirm'&gt;
        &lt;div class='header'&gt;&lt;span&gt;Confirm 123&lt;/span&gt;&lt;/div&gt;
        &lt;div class='message'&gt;&lt;/div&gt;
        &lt;div class='buttons'&gt;
            &lt;div class='no simplemodal-close'&gt;No&lt;/div&gt;&lt;div class='yes'&gt;Yes&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;!-- preload the images --&gt;
    &lt;div style='display:none'&gt;
        &lt;img src='img/confirm/header.gif' alt='' /&gt;
        &lt;img src='img/confirm/button.gif' alt='' /&gt;
    &lt;/div&gt;
&lt;/div&gt;
    &lt;/div&gt;


    &lt;!-- Load JavaScript files --&gt;
    &lt;script type='text/javascript' src='js/jquery.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='js/jquery.simplemodal.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='js/confirm.js'&gt;&lt;/script&gt;

    &lt;script type="text/javascript"&gt;
  $('.confirm').dialog({modal:true});
      $('.confirm').modal();
  $(".confirm").click();

    $(document).ready(function(){
   $('.confirm').dialog({modal:true});
       $('.confirm').modal();
   $(".confirm").click();
     });​

    &lt;/script&gt;

    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
