I have a button of download,when clicked it should change the text of the element span but I have problem in ajax part
after clicking it will show me a little button and the text will not change
here is my html
//somecode
<span class="num">Downloaded:<?php echo $downloadcount;?></span>
</td></tr>
</table>
</div>
<button type = "button" class="button" id="<?php echo $id; ?>" name="dl">
<a href='./mp3/<?php echo basename($filename);?>'>Download</a>
</button>
</td>
</tr>
</table>
here is my ajax:
$(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('<img src="dot.gif" align="absmiddle">');
$.ajax({
type: "POST",
url: "download_number.php",
data: dataString,
cache: false,
success: function(html)
{
//THE PROBLEM IS HERE
$(".num").text(html);
} });
}
});
});
I also tried $(".num").html(html);