CopyCode The Code is as follows: <script language = "JavaScript" type = "text/JavaScript">
Function countnum ()
{
VaR COUNT = Document. getelementbyid ("txttext"). value. length;
Document. getelementbyid ("lblcount"). value = count;
}
</SCRIPT>
Copy codeThe Code is as follows: <asp: textbox id = "txttext" name = "txttext" runat = "server" columns = "80" rows = "8" textmode = "multiline"
Width = "pixel PX" Height = "150px" onkeydown = "countnum ();"
Onmousemove = "countnum ();" onmouseout = "countnum ();" onkeyup = "countnum ();"> </ASP: textbox>
(The word <input id = "lblcount" type = "button" style = "border-style: none; Background: none;" value = "0"/> has been entered)
| Mouse and keyboard events |
| Event |
Description |
| Onclick |
Click an event. |
| Ondblclick |
Double-click event |
| Onmousedown |
The button on the mouse is pressed. |
| Onmouseup |
Events triggered when the mouse is pressed and released |
| Onmouseover |
Event triggered when you move the cursor over an object range |
| Onmousemove |
Events triggered when you move the mouse |
| Onmouseout |
Event triggered when the mouse leaves the range of an object |
| Onkeypress |
Event triggered when a key on the keyboard is pressed and released. [Note: The page must contain focused objects] |
| Onkeydown |
Events triggered when a key is pressed on the keyboard [NOTE: The page must contain focused objects] |
| Onkeyup |
Events triggered when a button on the keyboard is pressed and opened [NOTE: The page must contain focused objects] |