You will need to use a server-side script to do that. HTML cannot change from what is written and Javascript can only store data on the client. If you only want the link to work 20 times total for anyone you will need to keep that record on the server and use a php or other script to serve the appropriate page once the count has reached 20.