Bootstrap-maxlength使用详解编程语言
2023-06-13 09:20:42 时间
这是一款非常酷的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 姓名: /div div input type="text" maxlength="10" id="name" /div div 住址: /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/
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/14571.html
cjava相关文章
- validate bootstrap 方法「建议收藏」
- bootstrap table表格分页样式问题[通俗易懂]
- 利用Hudi Bootstrap转化现有Hive表的parquet/orc文件为Hudi表
- 二进制部署k8s教程18 - TLS Bootstrap完整配置
- jQuery自动触发事件与bootstrap/jQuery插件用法
- bootstrap-suggest插件处理复杂对象时的解决方案
- BootStrap-table刷新按钮与搜索框高度问题
- bootstrap-table插件实现分页(服务端分页)
- R语言使用bootstrap和增量法计算广义线性模型(GLM)预测置信区间|附代码数据
- MySQL Error number: MY-010940; Symbol: ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP; SQLSTATE: HY000 报错 故障修复 远程处理
- Bootstrap基础篇—常见的CSS类详解编程语言
- bootstrap学习笔记(增加网格应用)详解编程语言
- Spring Boot 核心配置文件 bootstrap & application 详解。编程语言
- bootstrap select 多选的用法,取值和赋值(取消默认选择第一个的对勾)详解编程语言
- jquery实现BootStrap的弹出框拖动,及鼠标滚轮改变BootStrap的弹出框大小详解编程语言
- bootstrap改变按钮加载状态