location.hostname()
We can get the hostname of the current page by using location object , Here is the example.
location.hostname();
Sample code is here.
<script language='JavaScript' type='text/JavaScript'>
<!--
document.write(location.hostname);
//-->
</script>
The output is here
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
plus2net.com
|