I'm trying to create a new option on the fly, and then add it right before the last option.
When I use $("#select").append("<option>hi</option") , it is always added after the last.
How to add a new option before the last selection option?
source share