My naive approach is the following:
function isClickable(id){ elem = document.getElementById(id); if (elem.nodeName.toLowerCase() == 'a' || typeof(elem.click) != 'undefined'){ return true; }else{ return false; } }
Is there anything better I can do?