Split selector fn to a new component (jquery)