Copy Code code as follows:
/* ================================================================================
File:jquery.hy.input.js
Desc: Some ways to extend the input
Called by:
Auth: Big Weather
Date:2009-10-30
================================================================================
Change History
================================================================================
Date:Author:Description:
-------- -------- -------------------
================================================================================
Copyright (C) 1992-2009 Hongye Corporation
================================================================================
*/
Extending the JQuery object method
JQuery.fn.extend ({
/*===========================================================================
Feature Description: Empty text box when clicked
Call Method:
$ (function () {jQuery ("#txt"). Txtclear ();
*/
Txtclear:function () {
JQuery (This). Click (function () {
JQuery (This). Val (');
});
},
/*===========================================================================
Functional Description: Select All selected
Call Method:
Situation
<div id= "Chkboxes" >
<input id= "Checkbox1" type= "checkbox"/>
<input id= "Checkbox2" type= "checkbox"/>
</div>
Call
$ ("#chkBoxes Input[type=checkbox]"). Check ();
*/
Check:function () {
Return This.each (function () {this.checked=true;});
},
/*===========================================================================
Feature Description: Canceling selection
Call Method:
$ ("#chkBoxes Input[type=checkbox]"). Uncheck ();
*/
Uncheck:function () {
Return This.each (function () {this.checked=false;});
}
});