当前位置:编程学习 > asp >>

Asp.net_实时显示文本框字数

[javascript]
<script language="javascript" type="text/javascript"> 
        function countNum() 
        { 
            var count=document.getElementById("txtText").value.length; 
            document.getElementById("lblCount").value=count; 
            } 
    </script> 

<script language="javascript" type="text/javascript">
        function countNum()
        {
            var count=document.getElementById("txtText").value.length;
            document.getElementById("lblCount").value=count;
            }
    </script>[csharp] view plaincopyprint?   <asp:TextBox ID="txtText" name="txtText" runat="server" Columns="80" Rows="8" TextMode="MultiLine" 
       Width="650px" Height="150px" onkeyup="countNum();"></asp:TextBox> 
(已输入<input id="lblCount" type="button" style="border-style: none; background: none;" value="0" />字) 

                    <asp:TextBox ID="txtText" name="txtText" runat="server" Columns="80" Rows="8" TextMode="MultiLine"
                        Width="650px" Height="150px" onkeyup="countNum();"></asp:TextBox>
                 (已输入<input id="lblCount" type="button" style="border-style: none; background: none;" value="0" />字)

补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,