Is website prefore by hand? Is auto good?

It would be easier to answer if I had a better idea of what you want to achieve.

Do you really need a method to insert the class automatically, or are you just looking for the best way to achieve the result in the example?

@ronpat has provided a “matching pairs” technique which might be sufficient for your needs without any need for scripting. See this recent discussion: Nav link colour change

1 Like