var tag = false; if(document.activeElement){ tag = document.activeElement.tagName; } if(tag==="INPUT" || tag === "TEXTAREA" || tag==="SELECT" || tag.value){ alert("active element is editable"); }