I think iOS is a great place to start learning programming. Being able to use storyboards to literally connect UI elements like buttons and sliders to small bits of code is easy to understand and quick to pick up.
The code is all there to look at, just right click > view source for most desktop browsers.
But in brief, it's a fairly simple case of using JS to set "window.location.hash" to whatever value necessary. If you want to test this out, you can open your browser's JS console (on any website), and simply type something like this:
window.location.hash="test"
and it'll update the URL displayed in your navigation bar.
Then it's just a case of using some JS code to generate the text to place in the navigation bar. It's quite a neat idea, but it's also pretty simple.