I have two textbox in Asp.Net: first for password and second is for a matching password.
How can I validate whether user entered different value in both textboxes through JavaScript at client side?
Have you considered the CompareValidator control for this?
It's what the CompareValidator was designed for.
edit - added
If you just want the javascript and want to do it completely in javascript, here's an example:
However, the CompareValidator takes care of generating the javascript for you (as long as client side validation is turned on), so in my opinion (and it IS just an opinion) you're making it harder on yourself by writing the javascript yourself.