When you see href="#" in live code on a web page it means that the person who wrote the page has made a mistake. You should never see href="#" in the actual source code of a web page because the # by itself is actually invalid and meaningless.
A # is valid in an href attribute provided that it isn't the only character in the value. Where the # is followed by additional characters those additional characters are the value of an id attribute elsewhere in the current web page and the page will jump to display the tag containing that id as close as possible to the top of the browser viewport. For example will jump to in the same web page. If you also have a filename preceding the # then the id it will jump to will be within that web page so will jump to that id on the next.htm page.
A # character is not valid as the last character of the href since it implies that you want to jump to an id within the page but the value of the id to jump to hasn't been specified. The action the browser should take in that instance is undefined however most will simply jump back to the top of the current page.