You are here: Reference > JavaScript > client-side > style handling > properties > imeMode

imeMode style property

Browser support:
3
Specifies or returns the state of an Input Method Editor (IME) for user text entry fields. IME allows users to enter and edit Chinese, Japanese, and Korean characters.
Note: The imeMode property is supported in Firefox from version 3.

Syntax:

object.imeMode;
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: ime-mode

Possible values:

The type of this property is string.
 One of the following values: 
active
All characters are entered through the IME by default.
auto
Default. No change is made to the current IME entry mode.
disabled
Deactivates IME, user may manually activate the IME.
inactive
All characters are entered without IME.
Default: auto.

Example HTML code 1:

This example illustrates the use of the ime-mode property:
<head>
    <style>
        .example {
            ime-mode: active;
        }
    </style>
</head>
<body>
    <input class="example" type="text" />
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the imeMode property in JavaScript:
<head>
    <script type="text/javascript">
        function ChangeImeMode (selectTag) {            
            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the selected options values
            var selectState = selectTag.options[whichSelected].text;

            var input = document.getElementById ("myInput");

            if ('imeMode' in input.style) {
                input.style.imeMode = selectState;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <input id="myInput" style="ime-mode: active;" type="text" value="change ime-mode" />

    <br />
    <select onchange="ChangeImeMode (this);" size="4">
        <option />auto
        <option selected="selected" />active
        <option />inactive
        <option />disabled
    </select>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content