I need a bit help here. I have javascript function for removing white space and http(s)*: from input form. script type="text/javascript"> function removeWhitespace() { var txtbox = document.getElementById('txtOne'); txtbox.value = txtbox.value.replace(/\s/g, ""); txtbox.value = txtbox.value.replace(/^http(s)*:\/\//i, ""); } </script> Code (markup): Then inside input tag i have <input type="submit" value="" onclick="removeWhitespace()" /> Code (markup): It works excellent but what i need now is also one extra line to remove also www. so that i can get get clean domainname. thanks