I want to get device phone number through JavaScript for validating user.
I am sending sms to client when he clicks on a URL I need to perform some operation
Ask them to enter in into a form - otherwise Ankit is right, it's a security / privacy issue. They might not want you to know their number.