javascript extract hostname from url code example
Example: javascript regex get domain from url
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}