What is the difference between calling a JavaScript function directly like onClick="a()" and onClick="javascript:a()"?

Nitesh Naveen

When a script is expected, there is no difference and you don't need the 'javascript:' there... It is used where the expected input is not a script. For example, in the href of anchor tag if you want to call a JavaScript function when you click on the link instead of a url which is the default expected input.