Dynamic change of the state of menu items

Is it possible to achieve this without connecting a third-party script?

Community Page
Last updated: