I suppose you can use some kind of encryption method for this identifier and then assign it dynamically to your href, however would it be easier to just use the form instead of href to accomplish what you want here? So:
<form method="post" action="testDetails"> <input type="text" hidden name="id" value="3"/> <input type="submit" value="Send"/> </form>
This way you can access the POST identifier var "id" to get your value, and it wonβt appear in the address bar as you requested.
source share