Try the following solution
script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<<script>
$(document).ready(function () {
$("#btnGet").click(function (e) {
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: "WebService.asmx/GetDateAndTime",
success: function (data) {
$("#DateTime").html(data.d);
},
error: function () {
alert("The call to the web service failed");
}
})
e.preventDefault();
});
});
</script>
</script>
call web service in asp.net using jQuery ajax