Q:

Label defined in onclick event, like "javascript:bSubmitted=true"

In an old piece of legacy code I found the following onclick event:
onclick="javascript:bSubmitted=true;"

Does anyone know what the javascript: label in front of this code does? I have never seen this notation before, and as far as I know whatever is in the onclick event is always javascript. Removing it, or changing it to something else doesn't seem to have an effect and IntelliJ seems to think it's an 'unnecessary label'.
Just out of curiousity I still would like to know what it does and what it can be used for. Does anyone know?

A:

I think you can find your answer here (it's the only "official" source I've found that talks about this): HTML Standard. 
Taken from 7.8.1 Navigating across documents

If resource is a request whose url's scheme is "javascript" Queue a
  task, on the DOM manipulation task source and associated with the
  active document of browsingContext, to run these steps:
Let response be the result of executing a javascript: URL request
  given resource, the source browsing context, and browsingContext. Run
  process a navigate response with resource, response, navigationType,
  the source browsing context, browsingContext,
  incumbentNavigationOrigin, and activeDocumentNavigationOrigin.

Basically, the javascript: can be used as an url scheme which (just for adding something to the boilerplate) was and still is used for many XSS injections. 
In that case specifically (upon a click event) it sounds unnecessary indeed, while it could be useful on an href, as you may see here (fiddle linked because the StackOverflow snippet manager doesn't allow alerts on javascript:): https://jsfiddle.net/73rmzjgw/

