The code isn't necessarily eloquent, although doesn't seem to have any bugs to my understanding nor any performance issues.
1. When answering Japanese-based tests on Memrise.com, you may realize that in doing so you forget to change your IME from Hiragana to Katakana or vice versa.
2. Not all courses will tell you to type in either "Hiragana" or "Katakana", and may instead just say something as ambiguous as "type in Kana" or "type in Japanese".
This script will detect whether the required answer should be a) Hiragana, b) Katakana, c) both.
If you type in the wrong format, a red colored error will display below the answer field and you will be unable to press the "enter" key until you enter the correct format.
This script will NOT tell you the answer or if you're correct (that's Memrise's job!) - it will only tell you the correct format.
This script will not affect any course that doesn't utilize Hiragana or Katakana character codes.