javascripthtml

How do I get the word behind a # in a URL to display between html label tags


I have a webpage dat greets you with welcome {name}. But the {name} has to be replaced with a name/word at the end of the url. The best I would find is after the # but something else is welcome.

I have tried to look up the different parts and put them together. But I don't know much about Javascript and it display the script that pulled the url instead of the output of that script.


Solution

  • var hash = location.hash.substr(1); gets the value after the #

    Feels like this might have been asked before.