I want to send a ajax post request to the page when clicked.My code
$(document).on('click', '#datadel', function(num) {
$.ajax({
url:'https://localhost/ajax/ajax_img.php?act=datadel',
type: 'POST',
data: {'num':num},
success: function(infa){
$('#img-loag-scrin').html(infa);
}
});
});
html code
<span id="datadel" class="sf_button_red" value="50">O`chirish</span>
then the value in the span should be sent as a post. what's wrong with the code I wrote