Here is my code:
$('a').on('click', function(){
myfunc($(this));
});
function myfunc(el){
console.log('Either left or middle click clicked on the link');
}
a{
cursor: pointer;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a>click</a>
My code works just for left click. How do I run that function when the users clicks on the link through the middle-click too?