Graham
Keyarn http://baretest.xtgem.com/button <script>
function first(){
document.getElementById('main').innerHTML='<b>The first page</b>';
document.getElementById('button').setAttribute('onclick','second()');
document.getElementById('button').innerHTML='second';
}
function second(){
document.getElementById('main').innerHTML='<b>The second page</b>';
document.getElementById('button').setAttribute('onclick','third()');
document.getElementById('button').innerHTML='third';
}
function third(){
document.getElementById('main').innerHTML='<b>The third page</b>';
document.getElementById('button').setAttribute('onclick','first()');
document.getElementById('button').innerHTML='first';
}
</script>
<div id="main">default content on first load</div>
<button id="button" onclick="first()">first</button>
Copy code The content will be loaded and the button will change when clicked