WANAKANA.js Mobile-friendly and lightweight
Japanese Hiragana & Katakana IME

DownloadVersion
View project on GitHub
var input = document.getElementById('ime');
wanakana.bind(input);

Additional functions

nihongonotesuto
wanakana.toRomaji(str);
トフグのすし
wanakana.toKana(str);
あめりか
wanakana.toHiragana(str);
ワニカニ
wanakana.toKatakana(str);

Full Documentation

Function Usage
wanakana.bind(element) Automatically bind IME functionality to a form textarea or input.
wanakana.unbind(element) Unbind IME from element.
wanakana.isHiragana(string) Returns false if string contains mixed characters, otherwise true if Hiragana.
wanakana.isKana(string) Returns false if string contains characters outside of the kana family, otherwise true if Hiragana and/or Katakana.
wanakana.isKatakana(string) Returns false if string contains mixed characters, otherwise true if Katakana.
wanakana.toHiragana(string[,options]) Convert Katakana or Romaji to Hiragana.
wanakana.toKana(string[,options]) Convert Romaji to Kana. Lowcase entries output Hiragana, while upcase entries output Katakana.
wanakana.toKatakana(string[,options]) Convert Hiragana or Romaji to Katakana.
wanakana.toRomaji(string[,options]) Convert Kana to Romaji.
options = {
IMEMode: false, useObsoleteKana: false }

Optional 'options' with their defaults.

IMEMode: Set true to handle input from a text input as it is typed.
useObsoleteKana: Set true to use obsolete characters, such as and .

Library Ports

Language Library Name
Java WanaKanaJava