The following code will display the id of an input element in both IE and Safari. However, it will only display the id of a non-input div in IE. The alert message in Safari is blank. Could someone show me how to get the id of a div (non-input element) in Safari.

Thanks,


Code:
window.addEventListener('click', function() {
		divId(document.activeElement.id);
}, false);

function divId(div) {
      alert(div);
}