Print a number table request by the user in ajax.

Asked 19-Aug-2021
Viewed 692 times

1 Answer


<!DOCTYPE html>
<html lang='en'>
<meta charset='utf-8'>
<title>Example of Sending Data with Ajax GET Request in jQuery</title>
<script src=''></script>
       // Get value from input element on the page
       var numValue = $('#num').val();
       // Send the input data to the server using get
       $.get('/examples/php/create-table.php', {number: numValue} , function(data){
           // Display the returned data in browser
   <label>Enter a Number: <input type='text' id='num'></label>
   <button type='button'>Show Multiplication Table</button>
   <div id='result'></div>