Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the following code:

<a onclick="javascript:alert()">

how do you name the javascript: part? Protocol, pseudo-protocol, scheme, label, prefix?

I am only trying to figure out a common name for it, not technically correct term based on what it actually is at the end. So when I say for example "javascript protocol" most people would be able understand what I mean. (I need to use this in a documentation)

share|improve this question

< a onclick="javascript:alert()">

I don't believe using javascript: in anything other than the href attribute is even valid (though it appears browsers will still execute it - I believe this is because technically javascript: in this context is a label, are you planning to goto javascript;?).

Also, it's considered very bad form to use inline event handlers like that. And if I'm not mistaken it's even been deprecated by W3C.

But, fwiw, when javascript: is used in an href it is called a "pseudo-protocol identifier".

share|improve this answer
You could use it to break an outer loop. But even that purpose is essentially forgotten. – Reid Mar 25 '11 at 22:41
@Reid: and completely irrelevant (for use) in an inline event handler. – quentin-starin Mar 26 '11 at 0:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.