There is one potential bug here, that lines 10 and 12 operate globally instead of being scoped to the current element. So on your giving page where there are many tipping fields, this could behave in unexpected ways.