how to get only domain name from url and display itin reactjs code example Example: get domain name javascript window.location.hostname