jQuery selector for document and another element
- by James
Can I merge these in jQuery? I'm using the HotKeys plugin.
$(document).bind('keydown', 'n', cycleNoise);
$(document).bind('keydown', 's', pickRandom);
$(document).bind('keydown', 'v', toggleTasks);
$(document).bind('keydown', 't', toggleTimer);
$(document).bind('keydown', 'up', hideTask);
$(document).bind('keydown', 'down', nextTask);
$('#duration').bind('keydown', 't', toggleTimer);
$('#duration').bind('keydown', 'n', cycleNoise);
$('#duration').bind('keydown', 's', pickRandom);
$('#duration').bind('keydown', 'v', toggleTasks);
$('#duration').bind('keydown', 'up', hideTask);
$('#duration').bind('keydown', 'down', nextTask);
In other words, is it possible to use document and '#duration' in the same selector. The following doesn't seem to work:
$(document + ',#duration').bind(...);