2013年8月21日 星期三

jquery-each jquery-for-each


jquery-each jquery-all
it can scan the whole web and add program on that.

**************************************************

$('.SALES_ORDER_INV_DESC_CONFIRM' ).each(function( index ) {
this.checked =(!this.checked)
})

***********************************************
s=""
s1=""
$( "#d td" ).each(function( index ) {
s=s+s1+$(this).text();
s1=s1+","
//nsole.log( index + ": " + $(this).text() );
});
_refreshv("divisionPermit",s);



$(window).load(function() {
$( "a" ).each(function (i) {
s=$(this).text();
s=s.toUpperCase();
//authorizes=authorizes.toUpperCase();
for (x in authorizes){if (s.indexOf(authorizes[x])>0 || s.indexOf(']')>=0 || authorizes=='all'  || authorizes=='ALL')
{this.style.color = "black";
}
}
});

$( "a" ).each(function (i) {
if (this.style.color!="black"){
this.href="removeIt"
$(this).remove();
}
});
$("li:empty").remove();
});


$(document.body).click(function () {
$( "div" ).each(function (i) {
                /*program here*/
if ( this.style.color != "blue" ) {
this.style.color = "blue";
alert(this.id);
} else {
this.style.color = "";
}
});
});


$( "li" ).each(function( index ) {
console.log( index + ": " + $(this).text() );
});

沒有留言:

張貼留言