set data-state attribute on change