Is it possible to increment the URL ID and open incremented page when a button is clicked in JavaScript?
For example, if the ID is http://www.someurl.com/index.php?id=17
When a button is clicked to load this iframe link:
http://www.someurl.com/index.php?id=18
<button onclick="increment()">Increment</button>
<div id="iframe">
<script>
var id = 17;
var link='<iframe src="http://www.myurl.com/index.php?id=' + id + ' " height="600px" width="100%" />';
function increment(){
id++;
document.getElementById('iframe').innerHTML = id + link;
}
</script>
</div>
OnClick Id is incremneting but the content is still same...