javascript: inside the onwhatever="" no-op handler. The content of this attribute is always JavaScript, so javascript: defines the label - but outside of the switch block or loop (where you can use it to break / continue at the label position), it does nothing.
However, the use of inline event handlers is not recommended; better methods for registering event handlers are better .
Although not mentioned in the question, it is worth noting that using javascript: in the href attribute really works (and it is really necessary there), but is very discouraged for various reasons:
this does not point to an element- Calling a function that returns a value causes the browser to leave the site.
- By clicking on the link with JavaScript breaks disabled
- Trying to open a link in a new window / tab
So, if you really need to use inline events, always use onclick="" , etc. without javascript:
Thiefmaster
source share