Trying to handle ctrl+click event on Internet explorer. All the other versions like Alt+click, Shift+click works fine, but not ctrl+click. Checked on Windows IE Edge and 10,9,8 compatability modes.
Also read on other multiple stackoverflow questions that any mouse click should trigger 'click' event on IE. This ain't happening too. Only mouseup and mousedown events are getting handled in this case.
Is there any change that can be made to below code that makes ctrl+click and mouse clicks work?
<html>
<body>
<a href="https://www.google.com" target="_blank">Google Link</a>
<script>
var handler = function(event) {
console.log(event);
};
var anchorTag = document.getElementsByTagName('a')[0];
if (window.addEventListener) {
anchorTag.addEventListener('click', handler, false);
}
else anchorTag.attachEvent("onclick", handler);
</script>
</body>
</html>
Much appreciated if can be answered without Jquery.