Does anybody view custom state of an element?

Can anybody view custom state of any element using browser console or any js. skill?
When i change custom state of any element does user view it by browser or another way?

I want to use this function for sms verification. If anybody can observe, it is useless for me.

its not possible, youre safe.
custom states are per user/browser session. ,

Custom state values are sent to the browser, so yes it can be viewed by that individual if they really want to see it. It’s buried in the app code, but it’s in there. So if the value is not safe to share with literally anybody (including the legit user,) then you have some risk here.

Just to illustrate:


Thank you for replies. I want make this phone verification in one popup screen. What is the safe method of hide this temporary verification code from user? Write and read database?