There is nothing that needs to be done to enable SSL on the HTML / JavaScript side, provided that your web server is configured with a certificate and associated bindings and the firewall is configured correctly.
If you ask how to automatically redirect HTTPS, this can be done using JavaScript. Put something like this in the JavaScript file referenced at the top of each page.
if (window.location.protocol.toLowerCase() != "https:") { window.location.href = "https:" + window.location.href.substring(window.location.protocol.length); }
source share