javascript: How to check if an element is clickable or not -


my naive approach following:

function isclickable(id){           elem = document.getelementbyid(id);      if (elem.nodename.tolowercase() == 'a' || typeof(elem.click) != 'undefined'){         return true;           }else{         return false;           } }     

is there better can do?


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -