I want to split the website name and get only URL without the query string example: www.xyz.com/.php?id=1
the URL can be of any length so I want to split to get the URL to only xyz.com
able to split the URL and getting xyz.com/php?id=1 but how do I end the split and get only xyz.com
var domain2 = document.getElementById("domain_id").value.split("w.")[1];