inside html I want to render current url with # as addition inside a href element

Desired result would be for example: `<a href="/Home/Contact#">MyLink</a>`
so I tried with 

```
<a href="javascript: getUrl();">My link</a>
<script>
    function getUrl() {
        return window.location.pathname + '#';
    }
</script>

```

On page load this actually loads up this url from the script and as a result give me a blank page with `/Home/Contact#`content, once again I just to render this url inside my a href element, not to execute that link on page load.