jQuery 扩展对input的一些操作方法
作者:bea
代码如下: /* ================================================================================ File:jquery.hy.input.js Desc: 扩展对input的一些方法 Called by: Auth: 大气象 Date: 2009-10-30 ============================================================
代码如下:
/* ================================================================================
File:jquery.hy.input.js
Desc: 扩展对input的一些方法
Called by:
Auth: 大气象
Date: 2009-10-30
================================================================================
Change History
================================================================================
Date: Author: Description:
-------- -------- -------------------
================================================================================
Copyright (C) 1992-2009 Hongye Corporation
================================================================================
*/
//扩展jQuery对象方法
jQuery.fn.extend({
/*===========================================================================
功能描述:单击时清空文本框
调用方法:
$(function(){ jQuery("#txt").txtClear();} );
*/
txtClear:function(){
jQuery(this).click(function(){
jQuery(this).val('');
});
},
/*===========================================================================
功能描述:选择全选
调用方法:
情形
<div id="chkBoxes">
<input id="Checkbox1" type="checkbox" />
<input id="Checkbox2" type="checkbox" />
</div>
调用
$("#chkBoxes input[type=checkbox]").check();
*/
check:function(){
return this.each(function(){this.checked=true;});
},
/*===========================================================================
功能描述:取消选择
调用方法:
$("#chkBoxes input[type=checkbox]").uncheck();
*/
uncheck:function(){
return this.each(function(){this.checked=false;});
}
});
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- 一个可以兼容IE FF的加为首页与加入收藏实现代码
- JS OOP包机制,类创建的方法定义
- JQuery 网站换肤功能实现代码
- Javascript结合css实现网页换肤功能
- 简单实用的HTML到UBB转换脚本工具实现说明
- cnblogs csdn 代码运行框实现代码
- 键盘 keycode的值 javascript时触发事件时很有用的要素
- js 函数的执行环境和作用域链的深入解析
- 提高网站性能之 如何对待JavaScript
- JavaScript Sort 表格排序
- DOM 脚本编程中的兄弟节点
- javascript GUID生成器实现代码
- JavaScript中的JSON 中文版翻译
- json 实例详细说明教程
- json 入门基础教程 推荐
- jquery text()要注意啦
- CCPry JS类库 代码
- Iframe 自适应高度并实时监控高度变化的js代码
- 扩展jQuery 键盘事件的几个基本方法