Home >Web Front-end >JS Tutorial >jQuery extends some operation methods for input_jquery

jQuery extends some operation methods for input_jquery

WBOY
WBOYOriginal
2016-05-16 18:42:521193browse
Copy code The code is as follows:

/* ============= ================================================== =================
File:jquery.hy.input.js
Desc: Extend some methods for input
Called by:
Auth : Big Weather
Date: 2009-10-30
================================== ==============================================
Change History
============================================== ==================================
Date: Author: Description:
---- ---- -------- -------------------
================ ================================================== ==============
Copyright (C) 1992-2009 Hongye Corporation
====================== ================================================== =========
*/
//Extended jQuery object method
jQuery.fn.extend({
/*============ ================================================== =============
Function description: Clear the text box when clicked
Calling method:
$(function(){ jQuery("#txt").txtClear( );} );
*/
txtClear:function(){
jQuery(this).click(function(){
jQuery(this).val('');
});
},
/*======================================== ======================================
Function description: Select all
Calling method:
Situation




Call
$("#chkBoxes input[type=checkbox]").check();
*/
check :function(){
return this.each(function(){this.checked=true;});
},
/*============== ================================================== ===========
Function description: Unselect
Calling method:
$("#chkBoxes input[type=checkbox]").uncheck();
* /
uncheck:function(){
return this.each(function(){this.checked=false;});
}
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn