Recognized spellcheck errors

Hi.

Is there a way, how to check from JavaScript or a WebExtension whether an input/textarea contains a word highlighted by the spellchecker built into Firefox, i.e. if there is a typo there? I would like to handle the text potentially misspelled differently and will be more happy with relying on the Firefox spellchecker rather than bundling extra JS libraries.