Add CLASS attribute in Select widget Option Django

Asked

Viewed 114 times

1

I’m wearing a widget=forms.Select() in a forms.Form Django, however, when trying to add a CLASS attribute in Options, which is part of Select, I can’t, only in Select itself, I searched and only found Override options of the Django code, I believe there is something simpler in Django, an option that went unnoticed...

  • Could you explain why you want to put class us <option>?

  • I want to make a solution using Jquery, I need to capture a value in CLASS.

  • 1

    You are wrong. If you want to manipulate an option through Jquery, you can select the option by searching for its value and not by your class.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.