title: How to increment url ID parameter with onclick event
body: <p>Is it possible to increment the URL ID and open incremented page when a button is clicked in JavaScript?</p>
  
  <p>For example, if the ID is <a href="http://www.someurl.com/index.php?id=17" rel="nofollow">http://www.someurl.com/index.php?id=17</a></p>
  
  <p>When a button is clicked to load this iframe link: </p>
  
  <p><a href="http://www.someurl.com/index.php?id=18" rel="nofollow">http://www.someurl.com/index.php?id=18</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button onclick="increment()"&gt;Increment&lt;/button&gt;
  &lt;div id="iframe"&gt;
      &lt;script&gt;
          var id = 17;
          
          var link='&lt;iframe src="http://www.myurl.com/index.php?id=' + id + '  " height="600px" width="100%" /&gt;';
  
          
          function increment(){
          id++;
          document.getElementById('iframe').innerHTML = id + link;
  }
      &lt;/script&gt;
  &lt;/div&gt; </code></pre>
  </div>
  </div>
  </p>
  
  <p>OnClick Id is incremneting but the content is still same...</p>