Проставление класса "focused" на Input

JS
Код
      [].slice.call(document.querySelectorAll('input')).forEach(function(inputEl) {
    // in case the input is already filled..
    if( inputEl.value.trim() !== '' ) {
        classie.add( inputEl.parentNode, 'focused' );
    }
    // events:
    inputEl.addEventListener( 'focus', onInputFocus );
    inputEl.addEventListener( 'blur', onInputBlur );
});
function onInputFocus( ev ) {
    classie.add( ev.target.parentNode, 'focused' );
}
function onInputBlur( ev ) {
    if( ev.target.value.trim() === '' ) {
        classie.remove( ev.target.parentNode, 'focused' );
    }
}