I want to add class for my option element. Is that valid to add class attribute in HTML option element?
Yes it is valid.
From the W3Schools website:
The tag also supports the Global Attributes in HTML.
From which the class
attribute is a part of. Please note that often, the option
tag has formatting issues regarding the browser you are using, so styling it can be a little tricky.
If you're concerned that W3Schools probably isn't the most reliable source of good information, here is a more official link to this subject at W3.org.