how to remove https or http prefix from link in javascript code example Example: how to remove https link from javascript result = url.replace(/(^\w+:|^)\/\//, '');