If I click on a button is it possible to call an ajax after 5 secs?
HTML :
<button>Click</button>
<p id='output'></p>
AJAX:
$('button').click(function() {
$.ajax({
type: 'post',
url: 'save_student_db.php',
data: 's_name=' + $('#s_name').val() +
'&s_email=' + $('#s_email').val() +
'&s_phone=' + $('#s_phone').val() +
'&s_add=' + $('#s_add').val() +
'&dept_select=' + $('#dept_select').val() +
'&datepiker=' + $('#datepiker').val(),
success: function(reply_data) {
$('#output').html(reply_data);
}
});
});
Here I want when I click on the button then this ajax call will called after 5 secs. How can I do it? thank you.