to json values before setting as data attributes