Add classes to the select options using

I’m trying to filter my select options using a second drop down. I found this approach on Stack Overflow, where you use the class of the options to remove the ones that don’t match the value from the drop down used to filter.

Is it possible to add classes to the options when using the select function in HTML.Form? Or is there another way for me to filter the select options?


1 Like

In case anyone else is trying to do this. I ended up using jQuery to add the class to each option.

1 Like

You can also not use the select_tag thing and roll your own. The implementation should be relatively straight-forward. :slight_smile: