Return to Snippet

Revision: 67076
at August 6, 2014 21:29 by dmkim


Initial Code
el = document.createElement('DIV');
el.id="info";
document.body.appendChild(el);


var re=/\.([^\.]+?)$/;

domain = re.exec(location.hostname);

el.innerHTML= domain[1];

Initial URL

                                

Initial Description
Find top level domain in current address (JavaScript)

Initial Title
Find top level domain in current address (JavaScript)

Initial Tags

                                

Initial Language
JavaScript