According to chatgpt:
The spellcheck attribute (<input spellcheck="true"> or <textarea spellcheck="true">) only enables or disables the browser’s built-in spellchecking.
Browsers do not expose the results of that spellcheck to JavaScript for privacy and security reasons (e.g., otherwise scripts could snoop on what words you mistype).
You can enable/disable browser spellcheck, but you cannot read the error state programmatically. If you need programmatic access, you must implement your own spellcheck system.