We have a few dozen CSS pseudo-classes. Most browsers' developer tools allow us to examine/toggle only a handful of them like :hover
, :focus
, :active
.
How do you examine if a specific element has other pseudo-classes? How can you toggle them?
One example is that Bootstrap form validation applies :invalid
and :valid
pseudo-classes to an input
element depending on whether it has passed the validation. Suppose we need to debug custom validation rules and feedback by examining and toggling those pseudo-classes. How would you do it in developer tools?
I'm not limiting the question to Chrome DevTools; it's perfectly fine to answer this using any browser developer tools. Likewise, I'm not limiting this question to the specific use case of Bootstrap validation (it's just the first that comes to mind), since that use case covers just two of many other CSS pseudo-classes.