title: Displaying table items with JavaScript in HTML
body: <p>Why can't I display the table item?</p>
  
  <p>My code:</p>
  
  <pre><code>function get(){
      db.transaction(function(tx){
  
          tx.executeSql('SELECT * FROM ENTRIES', []);
          function show(){
              var len = results.rows.length, i;
              for(i=0; i &lt; len; i++){
                  alert(results.rows.item(i).text);
              }
          }
      });
  }
  </code></pre>
  
  <p>And there is this one:</p>
  
  <pre><code>function show(tx, results){
  
      var len = results.rows.length;
      for(i=0; i &lt; len; i++){
                  var row = results.rows.item(i);
                  console.log(rows.entry);
              }
  
  }
  </code></pre>
  
  <p>Neither of them work. I want to display the results somehow. Maybe in a <code>for</code> loop inside HTML in a div.</p>
  
  <p>Plus, the browser doesn't keep the data added:</p>
  
  <pre><code>function populateDB(tx) {
           tx.executeSql('DROP TABLE IF EXISTS ENTRIES');
           tx.executeSql('CREATE TABLE IF NOT EXISTS ENTRIES (id integer primary key autoincrement, entry text)');
           tx.executeSql('INSERT INTO ENTRIES (entry) VALUES (5)');
      }
  </code></pre>
  
  <p>I add data form an input, but once I refresh, it's gone. How?</p>