How to get the current domain name with the protocol in JavaScript

1 Answer

0 votes
const protocolAndDomainName =  window.origin;

console.log(protocolAndDomainName); 

  
    
    
/*
run:
    
"https://www.seek4info.com"
    
*/

 



answered Feb 23, 2021 by avibootz

Related questions

2 answers 270 views
1 answer 173 views
1 answer 166 views
...