i created a button (just like back)when i click on the button iam calling a function window.history.go(-1) when i click on three pages it is working fine .
how can i disable the button when the first page appears while clicking the button
How are you defining 'the first page' ? Can't you just remove the button from that page?
If not, you probably want to look into doing a comparison with