jQuery :: How to execute one function based off two possible events
<p>I'm looking for a clean way to fire one function that may be triggered by two possible events. For example:</p>

<pre><code>$('form').on('submit', function() {
    stuff in here...
});

$('input').on('change', function() {
    same stuff in here as before...
});
</code></pre>

<p>I could do</p>

<pre><code>function doStuff() {
    Stuff in here....
}

$('form').on('submit', function() {
    doStuff();
});

$('input').on('change', function() {
    doStuff();
});
</code></pre>

<p>But I was wondering if there was a more elegant way of doing this? </p>
