you should write a function like following : function a(linkId){location.href="[your location]?id="+linkId; } and write in body tag like following : <body>Link 1Link 2</body> you should handle [linkId] with server side script.