You can't. Or, at least you need a data-provider for actually sending the SMS - unless you want to trigger a function on a hooked-up phone? You cannot send SMS (part of the mobile GSM/3G/4G-network) via web/javascript. You might be able to work with an existing API from a SMS-provider, however.
Create a basic API written on a server that will send the message. Within JavaScript then call your API.