you are trying to get a html element value then request the server then display the fetched details to your browser
below is the whole example and i have included the script in it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AJAX</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
// Get value from input element on the page
var numValue = $("#num").val();
// Send the input data to the server using get
$.get("../php/create-table.php", {number: numValue} , function(data){
// Display the returned data in browser
$("#result").html(data);
});
});
});
</script>
</head>
<body>
<label>A number Between 10 t0 100 <input type="text" id="num"></label>
<button type="button">Generate Table</button>
<div id="result"></div>
</body>
</html>