var a=new Array('dsda','fjjd','fhhd','dsda','dsda','fjjd','f hhd','dsda'), b = []; for (var i=0; i<a.length; i++) { if (a[i] == "dsda") b.push(i) } alert(b);