Bootstrap-maxlength使用
来源:互联网 发布:大帝和雪兔分手知乎 编辑:程序博客网 时间:2024/06/05 00:18
这是一款非常酷的jQuery实现的Bootstrap插件,允许输入用户字符数.它可以让你显示字符用户插入的最大长度。
1、引入jquery.js及bootstrap-maxlength.js
2、给页面的input或textarea加上maxlength属性
<input type="text" maxlength="10" id="name">
3、配置选项$(function(){ $('#name').maxlength({ alwaysShow: true });})代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>bootstrapl.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="js/bootstrap-maxlength.js"></script> </head> <body> <div style="float: left"> 姓名: </div> <div> <input type="text" style="width:303px" maxlength="10" id="name"> </div> <div style="float: left"> 住址: </div> <div> <textarea name="textarea" id="address" maxlength=20 rows="5" cols="40"></textarea> </div> </body> <script type="text/javascript"> $(function(){ $('#name').maxlength({ alwaysShow: true }); $('#address').maxlength({ alwaysShow: true }); }) </script></html>效果如图:
官网: http://mimo84.github.io/bootstrap-maxlength/
0 0
- Bootstrap-maxlength使用
- Bootstrap-maxlength使用
- 关于maxlength的使用
- input number maxlength 失效 移动端使用
- TextBox 在 MultiLine 模式时无法使用 MaxLength 属性
- maxLength要与inputType属性同时使用才会生效
- Bootstrap 使用
- 使用Bootstrap
- Bootstrap 使用
- bootstrap使用
- Bootstrap使用
- bootstrap使用
- bootstrap使用
- bootstrap使用
- bootstrap使用
- Bootstrap 使用
- 【bootstrap】使用bower安装bootstrap
- bootstrap(1)bootstrap-datepicker使用
- 98. Validate Binary Search Tree(中序遍历判断BST)
- 理解本真的REST架构风格
- 中国剩余定理(模板+代码)
- 文本格式化标签
- 跟我一起写 Makefile(一)
- Bootstrap-maxlength使用
- Xcode中的Info.plist字段列表详解
- LLL算法JAVA实现
- 剑指Offer面试题17(Java版):合并两个排序的链表
- 设计模式之 工厂模式(demo)
- Angularjs ng-form
- 关于在外部对内部类进行实例化和引用
- C++(构造函数&&析构函数)
- Comparable 和 Comparator 的区别