i am new to jQuery as well as programming, how can i check whether two array elements belong to same array. I did this.. but its not working
var blackCoins = ["♚", "♛", "♜", "♝", "♞", "♟"];
var whiteCoins = ["♔", "♕", "♖", "♗", "♘", "♙"];
var buffer = $("myselector1").text();
var storeBuffer = $("#myselector2").text();
var flag = 0;
if ($.inArray(buffer, whiteCoins) > -1 && $.inArray(storeBuffer, whiteCoins) > -1){
flag = 1;
}
else if($.inArray(buffer, blackCoins) > -1 && $.inArray(storeBuffer, blackCoins) > -1) {
flag = 1;
}
}
i can give more information if needed..