Been asked before here and here and here.
The custom script you need depends on your nav structure.
In your case you are using a dropdown component, the text of the dropdown does not supports an active state - only links can.