I'm trying this rough script idea. But it is not working.
<script>
function storeurl() {
var varurl = document.URL;
}
document.onclick = storeurl;
document.write(varurl);
</script>
varurl is set as the actual url using document.URL function.
with <a href="#2">broogle</a>
then on click i would like varurl to be set to #2 and then echo.
In a perfect world this script would echo
http://url/#2
when clicking on the link
Any help? Thx