title: Change color of div with Ajax
body: <p>How to change color of div within ajax ?
  The div is called rowMain , but i have several divs of same as listing records.</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function() {
          $("#submit-productdescription").submit(function() {
                   var row = $(this).parent('.rowMain');
                   $.ajax({
                       type: $(this).attr('method'),
                       url: 'EbayBuy-ReceivedUpdate.php',
                       data: $(this).serialize(),
                       success: function (data) {                         
  
                           row.css("background-color", "#787878");
  
                 }, error: function(jqXHR, textStatus, errorThrown){
                console.log(" The following error occured: "+ textStatus, errorThrown );
              } });
             return false;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>This does not update the row, i have also tried various options on divs within rowMain and still cant make them change.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> &lt;script&gt;
    $(document).ready(function() {
     $("#submit-productdescription").submit(function() {
        var row = $(this).parent('.rowMain');
        $.ajax({
         type: $(this).attr('method'),
         url: 'Update.php',
         data: $(this).serialize(),
         success: function (data) {
          
          row.css("background-color", "#787878");
          
         }, error: function(jqXHR, textStatus, errorThrown){
        console.log(" The following error occured: "+ textStatus, errorThrown );
      } });
        return false;
     });
    });
   &lt;/script&gt;</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.rowMain  { display: block;width:95%;float:left;min-width:750px;background:red; height:auto;padding:10px;  border-radius: 3px;border: 1px solid #000000 position: relative;margin-left:2.5%; margin-top:0px;margin-bottom:2px;  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="main" class="rowMain"&gt;
  
  &lt;form id="submit-productdescription" method="post" autocomplete="off" class="received"&gt;
       &lt;input type="hidden" value="&lt;?php echo $row['Id']?&gt;" name="id"&gt; 
       &lt;input type="submit" name="submit-productdescription" value="Received &lt;?php echo $row['Id']; ?&gt;-&lt;?php echo $row['Status']; ?&gt;" class="btn" /&gt;&lt;/form&gt;
            
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>