var gcode = "US"; var gcity = "Columbus"; var gcountry = "United States"; if(gcity != ''){ document.getElementById("pcity2").innerHTML = gcity; document.getElementById("pcountry").innerHTML = gcountry; }else{ document.getElementById("pcity2").innerHTML = 'Your Area'; document.getElementById("pcountry").innerHTML = 'Your Country'; } _paq.push([ function() { var mm_ref; mm_ref = this.getAttributionInfo(); var mf_vars = mm_ref.toString().split(","); var mf_domain = mf_vars[3]; var xds = (new URL(mf_domain)).hostname.replace('www.',''); window.onload = function(){ const xx = document.getElementsByClassName('mtms'); for (let i=0 ; i < xx.length ; i++ ) { xx[i].value = xds; } } }]);