title: how to change the text in element via ajax?
body: <p>I have a button of download,when clicked it should change the text of the element span but I have problem in ajax part</p>
  
  <p>after clicking it will show me a little button and the text will not change</p>
  
  <p>here is my html</p>
  
  <pre><code>//somecode
      &lt;span class="num"&gt;Downloaded:&lt;?php echo $downloadcount;?&gt;&lt;/span&gt;
       &lt;/td&gt;&lt;/tr&gt;
       &lt;/table&gt;
       &lt;/div&gt;
  &lt;button type = "button" class="button" id="&lt;?php echo $id; ?&gt;" name="dl"&gt;
      &lt;a href='./mp3/&lt;?php echo basename($filename);?&gt;'&gt;Download&lt;/a&gt;
  &lt;/button&gt;
           &lt;/td&gt;
       &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>here is my ajax:</p>
  
  <pre><code>    $(function() {
          $(".button").click(function() 
          {
          var id = $(this).attr("id");
          var name = $(this).attr("name");
          var dataString = 'id='+ id ;
          var parent = $(this);
          if(name=='dl')
          {
          $(this).fadeIn(200).html('&lt;img src="dot.gif" align="absmiddle"&gt;');
          $.ajax({
             type: "POST",
             url: "download_number.php",
             data: dataString,
             cache: false,
  
             success: function(html)
             {
  //THE PROBLEM IS HERE
              $(".num").text(html);
  
            }  });
  
          }
          });
          });
  </code></pre>
  
  <p>I also tried <code>$(".num").html(html);</code></p>