Code

<!-- Example #3 - Register multiple listeners -->
<script type="text/javascript">
/**
 * Add an additional onFocus listener to the provided elements
 * @param {HTMLElement} el
 * @param {function} fn
 */
function addOnFocus(el, fn) {
    // Cache the currently applied listener(s), if any
    var onF = el.onfocus;
    el.onfocus = function() {
        // Execute any existing listeners
        if (onF) {
            onF(el);
        }
        
        // Execute the new listener
        fn(el);
    };
}
</script>

<input type="text" name="onFocusTest" id="onFocusTest" />
<script type="text/javascript">
// Add a couple listeners to the element for testing
addOnFocus(document.getElementById("onFocusTest"), function() {
    alert("First listener");
});

addOnFocus(document.getElementById("onFocusTest"), function() {
    alert("Second listener");
});
</script>

Try It