title: jQuery - Applying css style to input element
body: <p>I am trying to check all links and change the background color of broken links field.
  Here is my function</p>
  
  <pre><code>function CheckLinks(){
  $('#new_post_links_table tbody&gt;tr').find("input").each(function() {
      UrlExists($(this).val(), function(status){
      if(status === 404){
         $(this).css('background-color','#FC0');
      }
  }); });}
  </code></pre>
  
  <p>Input fields looks like this :</p>
  
  <pre><code>&lt;table id="new_post_links_table"&gt;
  ...
  &lt;td&gt;&lt;input type="text" name="mp3_link[]"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="mp4_link[]"/&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>For some reason the css is not applying.</p>
  
  <p>Note: my CheckLinks function does work, except the <code>$(this).css...</code> part. (FireBug'ed)</p>
  
  <p>Note: The rows are added dynamically</p>
  
  <p>EDIT : Here is the function:</p>
  
  <pre><code>function UrlExists(url, cb){
      jQuery.ajax({
          url:      url,
          dataType: 'text',
          type:     'GET',
          complete:  function(xhr){
              if(typeof cb === 'function')
                 cb.apply(this, [xhr.status]);
          }
      });
  }
  </code></pre>