$(window).keydown(function (e){ if ((e.metaKey || e.ctrlKey) && e.keyCode == 83) { /*ctrl+s or command+s*/ yourFunction(); e.preventDefault(); return false; } });