asp.net real-time display text box word number implementation code _ Practical skills

Source: Internet
Author: User
Copy Code code as follows:

<script language= "javascript" type= "Text/javascript" >
function Countnum ()
{
var Count=document.getelementbyid ("Txttext"). Value.length;
document.getElementById ("Lblcount"). Value=count;
}
</script>

Copy Code code as follows:

<asp:textbox id= "Txttext" name= "Txttext" runat= "Server" columns= "no" rows= "8" textmode= "MultiLine"
Width= "650px" height= "150px" onkeydown= "Countnum ();"
Onmousemove= "Countnum ();" onmouseout= "countnum ();" onkeyup= "countnum ();" ></asp:TextBox>
(Entered <input id= "lblcount" type= button "style=" Border-style:none; Background:none; "value=" 0 "/> Word)

Mouse events, keyboard events
Event Describe
OnClick Mouse click events, more than the control of an object in the range of mouse clicks
OnDblClick Mouse Double-click event
OnMouseDown The button on the mouse was pressed
OnMouseUp Events fired when the mouse is pressed and released
OnMouseOver Event that is triggered when the mouse moves over a range of objects
OnMouseMove Events that are triggered when the mouse is moved
onmouseout Event triggered when the mouse leaves a range of objects
OnKeyPress The event that is triggered when a key on the keyboard is pressed and released.
[Note: There must be focused objects on the page]
OnKeyDown Event that is triggered when a key on the keyboard is pressed [Note: There must be a focused object on the page]
OnKeyUp An event that is triggered when a key on the keyboard is pressed to open [note: There must be a focused object on the page]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.