function getSeal(){ var targetTag = ''; var DOM_img = document.createElement("img"); DOM_img.src = "https://homewarrantyreviews.com/trust-seal-new.php?com_name=&sI=Yes"; DOM_img.className = "hwrTrustInfo"; DOM_img.style = "cursor: pointer;"; var target = document.documentElement; // start at the root element while (target.childNodes.length && target.lastChild.nodeType == 1) { // find last HTMLElement child node target = target.lastChild; } if(targetTag == 'N' || targetTag == ''){ target.parentNode.appendChild(DOM_img); }else{ document.getElementById(targetTag).appendChild(DOM_img) } } var element = document.getElementsByClassName('hwrTrustInfo'); if (typeof(element) != 'undefined' && element != null) { for(var i = 0, x = element.length; i < x; i++) { element[i].onclick = function(){ com_name = ''; window.open('https://homewarrantyreviews.com/company-trust-seal?cN='+com_name,'targetWindow','toolbar=no,location=no,addressbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=650') } } }