1、//#hidediv2为一个需要隐藏的div 这个功能实现当点击hidediv2以外的其他任何位置时,隐藏该div
$(document).click(function() {
try {
var _event = event ? event : window.event;
var _target = _event.target ? _event.target : _event.srcElement;
var _id = _target.id;
if (_id == ‘‘) {
$("#hidediv2").hide(100);
}
}
catch (eee) { }
})
2、//asp.net gridview中checkbox的全选功能
function CheckAll() {
if (a == 1) {
for (var i = 0; i < window.document.form1.elements.length; i++) {
var e = form1.elements[i];
e.checked = false;
}
a = 0;
}
else {
for (var i = 0; i < window.document.form1.elements.length; i++) {
var e = form1.elements[i];
e.checked = true;
}
a = 1;
}
}