Tag browsing: how to code javascript