If you're changing the actual name/content of the toggle, you likely don't want to use aria-pressed
, as it would result in weird/confusing announcements by assistive technologies. The above example shows what not to do (it changes both the name of the control and aria-pressed
.
Note that in some browser/assistive technology combinations, the dynamic change of label/name may not be announced...