Combining a mousedown event with a keydown event
- by gotguts
I am trying to combine a keydown event with a mousedown event. Basically, I have a chat dialog, and if the user writes in one of 2 divs (keydown event) or makes a selection from either (or both) of 2 dropdowns (mousedown), I need these to have the same exact function. Thanks in advance.
Code (to be combined):
$('#usermsg').add('#otherComments').keydown(function() { // When key pressed
and
$('#strategies').add('#whySwitch').mousedown(function() { // When mouse is clicked
//function body
});