Ctrl+/
IE11
F11
ESC
PgUp
PgDn
<!DOCTYPE html>
<html>
<head>
<title>jQuery-计算文本框字数</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js">
</script>
</head>
<body>
<div class="main">
<div class="box">
<p>请在下面输入您的文字:
</p>
<textarea name="weibao" class="tex" cols="" rows="8">
</textarea>
<input type="button" class="but" value="确定" />
</div>
</body>
</html>
xxxxxxxxxx
.box{
width:500px;
margin:10px auto;}
*{
margin:0;
padding:0;
}
p span{
color:#069;
font-weight:bold;
textarea{
width:300px;
.textColor{
background-color:#0C9;
.but{
background-color:#066;
padding:5px;
color:#FFF;
border:1px solid #999;}
.grey{
background-color:#CCCCCC;}
$(function(){
var $tex = $(".tex");
var $but = $(".but");
var ie = jQuery.support.htmlSerialize;
var str = 0;
var abcnum = 0;
var maxNum = 280;
var texts= 0;
var num = 0;
var sets = null;
$tex.val("");
//顶部的提示文字
$tex.focus(function(){