title: Uncaught TypeError: Cannot read property 'html' of undefined - AJAX post answer only in spesific div
body: <p>I have this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'html' of undefined</p>
  </blockquote>
  
  <p>What I'm trying to create is a voting system for each video on my page from a database. I've managed to make it with AJAX the only problem is that I can't output the answer in the correct div class 'this' because it gets posted in each div with the class - so in under every video. </p>
  
  <p>I need a working solution to identify the parent div the user clicked vote button on and change only its own child bot others. </p>
  
  <p>Please help. Here is my jQuery code.</p>
  
  <pre><code>$(function() {
  
      $(".vote").click(function() {  
  
          var id = $(this).attr("id");
          var name = $(this).attr("name");
          var dataString = 'id='+ id ;
          var acdc = $('#ab').attr('class');
          var potato = 'potato';
          var parent = $(this);
          if(name=='up')
          { 
              $.ajax({
                  type: "POST",
                  url: "up_vote.php",
                  data: dataString,
                  cache: false,
                  success: function(html) { acdc.html(html);
                                          }}); 
          }
          else
          {
              $(this).fadeIn(200).html('&lt;img src="img/icon-down.png" align="absmiddle"     style="height: 10px;width:10px;"&gt;');
              $.ajax({
                  type: "POST",
                  url: "down_vote.php",
                  data: dataString,
                  cache: false,
                  success: function(html){ 
                      parent.parent().find('.this').html(html);
                  }}); 
          }
          return false;
      });
  
  });
  </code></pre>
  
  <p>here is html with video posts and div class'this' where my AJAX answer should be posted - but only in current one - as php script adds one vote to only the video with the spesific id, not all! </p>
  
  <pre><code> &lt;div class='botto'&gt;
    &lt;div class='icon-wrap'&gt;
     &lt;form action="blossom.php" method="post"&gt;&lt;?php $id =  $row["idv"]; ?&gt;
     &lt;input type="hidden" id="id" value="&lt;?php echo $row['idv']; ?&gt;" /&gt;
     &lt;div cass='homesick'&gt;
      &lt;button type='submit'name='up' style="background-color:transparent; border-color:transparent;outline: none; " class='icon vote' name="up"&gt;&lt;img src='img/thumbsup.png' alt='up' name='up' class='icon vote icon-up' id="&lt;?php echo $row['idv']; ?&gt;" &gt;&lt;/button&gt; 
           &lt;span class='number-vote this'&gt;
           &lt;?php
  
           echo $row['votev'];
  
           ?&gt;&lt;/span&gt;
      &lt;button type='submit' name='down' style="background-color:transparent; border-color:transparent;outline: none; " class="vote" name="down"&gt;&lt;img src='img/icon-down.png' alt='down' class='icon icon-down vote' id="&lt;?php echo $row['idv']; ?&gt;"&gt;&lt;/button&gt; 
      &lt;/div&gt;
     &lt;/form&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>