function showUnitConverter(e) { var thing = document.getElementById('unitconverter'); thing.style.display="block"; var dawibe = e.target || e.srcElement; el = dawibe.parentNode.nextSibling; while(el&&el.nodeType==3) { el=el.nextSibling; } el = el.firstChild; while(el&&el.nodeType==3) { el=el.nextSibling; } alert(el); }