title: Is it possible to onclick="history.clear();"
body: <p>I'm going to implement <strong>logout</strong> button in my PhoneGap application, which will return the user into authentication page (with cleared fields). For the button I'm using anchor with onclick event:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function doLogout() {
      var backlen = history.length;
      history.go(-backlen);
      window.location.replace("index.html");
  }
  &lt;/script&gt;
  
  &lt;a data-role="none" href="#" onclick="doLogout"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>but it's not works, i.e. it's just returns me to that authentication page with already filled fileds, seems like just a one step back. I'm not sure for <strong>history.clear()</strong>, because googling it gave me nothing:</p>
  
  <pre><code>&lt;a data-role="none" href="index.html" onclick="javascript:history.clear();"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Could anyone advise me where is my problem? If there is another solution to handle logout event in PhoneGap I would follow it. THanks</p>