create js function for creating option