isChar property (event)
Returns whether the character that belongs to the current event is a key character or not.
Returns inconsistent values (always false)! Do not use this property.
Check the value of the cross-browser keyCode property to determine whether a valid key was pressed.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read-only.
Possible values:
Boolean that indicates whether the character is a key character or not.
One of the following values:
The character is not a key character. | |||||||
The character is a key character. |
Default: false.
Example HTML code 1:
This example illustrates the use of the isChar property:
|
||||
<head> <script type="text/javascript"> function IsKeyChar (e) { var msg = (e.isChar)? "Key character was pressed." : "Not a key character was pressed."; alert (msg); } </script> </head> <body> <input type="text" onkeypress="IsKeyChar (event);" value="Press any key"/> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments