What is javascript: in a JavaScript event handler?
Such as:
<input onkeydown="javascript:return false;" type="text" name="textfield" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is a mistake. The pseudo-protocol is not needed in event handlers.
On a URL (
aelementhrefattribute, for instance), if you enterjavascript:and follow that with javascript, the browser will run the javascript code.For event handler, this is not needed, though the browser will not report an error.