Right now if I have multiple links using:
Options 1:
<a href="javascript:;" onClick="window.location.hash+='A'">Option A</a>
<a href="javascript:;" onClick="window.location.hash+='B'">Option B</a>
<a href="javascript:;" onClick="window.location.hash+='C'">Option B</a>
Options 2:
<a href="javascript:;" onClick="window.location.hash+='1'">Option 1</a>
<a href="javascript:;" onClick="window.location.hash+='2'">Option 2</a>
<a href="javascript:;" onClick="window.location.hash+='3'">Option 3</a>
Options 3:
<a href="javascript:;" onClick="window.location.hash+='X'">Option X</a>
<a href="javascript:;" onClick="window.location.hash+='Y'">Option Y</a>
<a href="javascript:;" onClick="window.location.hash+='Z'">Option Z</a>
Whenever clicking any of these, it will keep adding to the URL. Is there a way to check if a current hash already exists (ie. if third character in hash string, then replace with current hash). Any help would be great thanks! I'm trying to accomplish an end result which looks like below even if the user went back and forth between selecting options:
http://mydomain.com/question-page#A3Y