Check out this code snippet:
$('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>
I have a question about middle-click functionality. How can I modify the code to trigger the function when the user middle-clicks on the link?