Changed bubbling up function to support css selector to closest element upwards.