title: getting all html in the console trying ajax call with autocomplete
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta http-equiv="Content-Language" content="en-us"&gt;
      &lt;title&gt;PHP MySQL Typeahead Autocomplete&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"&gt;
  
  &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"&gt;&lt;/script&gt;
  
   &lt;/head&gt;
  
   &lt;body&gt;
  
          &lt;script type="text/javascript"&gt;
  
                  $(function() {
                      /*$( "#skills" ).autocomplete({
                          source: 'singleton.php'
                      });*/
                      $("#skills").keyup(function(){
                          $.ajax({
                              type: 'post',
                              url: 'singleton.php/',
                              data: 'term='+$(this).val(),
                              success: function(success){
                                  $("#suggesstion-box").html(data);
                              },
                              error: function(error){
                                  console.log("error");
                              }
                          })
                      })
                  });
                  &lt;/script&gt;
  
          &lt;/script&gt;
  
  &lt;?php
  /*include_once('connection.php');
  
  $conn = new Database();*/
  
  $hostname = "localhost";
  $username = "root";
  $password = "";
  $databasae = "employee";
  if(isset($_POST['term'])){
      $query = $_POST['term'];   
  
   $db = new mysqli($hostname,$username,$password,$databasae);
  
      //get search term
      $searchTerm = $_POST['term'];
  
      //get matched data from skills table
      $query = $db-&gt;query("SELECT * FROM city WHERE name LIKE '%".$searchTerm."%' ORDER BY name ASC");
      while ($row = $query-&gt;fetch_assoc()) {
          $data[] = $row['name'];
      }
  
      //return json data
      echo json_encode($data);
  }
  
  
  ?&gt;
  &lt;div class="ui-widget"&gt;
          Enter City Name: 
  
          &lt;input type="text" name="city" class="city" id="skills" placeholder="Enter City Name" id="city"&gt;
              &lt;div id="suggesstion-box"&gt;&lt;/div&gt;
  
          &lt;/div&gt;
   &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm getting correct value in the network but it does not populating data in suggestion-box div.</p>
  
  <p>I can't figure out where i'm mistaking.</p>