title: Change jqueryui dialog color after it has been opened using jquery, not css
body: <p>I'm trying to change the background of a jqueryui dialog box after it has been opened.  Requirements prevent me from setting this in the stylesheet because the background color or image is unique for the person who clicks on the link (the background values are being pulled from the database).</p>
  
  <p>When I run the following jquery command to change the css of the div after the dialog is loaded it doesn't do anything?</p>
  
  <pre><code>$("#modal_popup_website").css("background","red !important");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$("#modal_popup_website .ui-dialog-content").css("background","red !important");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$(".ui-dialog-content").css("background","red !important");
  </code></pre>
  
  <p>What am I doing wrong? </p>
  
  <p>First I initialize the dialog as follows:</p>
  
  <pre><code>$("#modal_popup_website").dialog({
              bgiframe: true,
              autoOpen: false,
              position: 'center',
              width: $(window).width()-30,
              minWidth: 990,
              height: 900,
              minHeight: 900,
              modal: true,
              stack: true, //Puts in front of other dialog's that may be open
              open: function(){
  
              },
              close: function() {
                  //Save
              }
  </code></pre>
  
  <p>Then I open the dialog when the user click on a link like this:</p>
  
  <pre><code>$("#modal_popup_website").dialog("open");
  </code></pre>
  
  <p>After it is open I put in some HTML into the dialog box like this:</p>
  
  <pre><code>$("#modal_popup_website").html('gets loaded from external file');
  </code></pre>
  
  <p>Heres the HTML of the external file:</p>
  
  <pre><code>&lt;div&gt;some text&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
     $("#modal_popup_website").css("background","red !important");
  &lt;/script&gt;
  </code></pre>
  
  <p>And the &lt; script > area is where I'm trying to change the css background.  In this external PHP file I retrieve the background color or image from the database for this user and I want to change the background of the dialog box, but I can't make it work.</p>
  
  <p>Any ideas will be appreciated!</p>
  
  <p>Thanks. </p>