I am now practicing my JS skills and Jquery.
var clickcheckboxcount=0;
var clickedcheckboxname = new Array();
var clickedcheckboxvalue = new Array();
$("#input[type=checkbox]").click(function(){
if ($('div:not([class~=clicked])'){
$(this).addClass(clickcheckboxcount+'clicked');
clickedcheckboxname.push($(this).attr("name"));
clickedcheckboxvalue.push($(this).val());
clickedcheckboxcount+=1;
}
there is serval checkbox with different name and value in HTML body part. I just want to get their attr and name by click them and don't want push same value in the array. So How can I rewrite if() function.
I put my codes demo in http://jsfiddle.net/Lza2L/