Array in attribute callout

Array in attribute callout

I'm trying to target a specific class that has an attr (myfield) equal to something from an array & then change the bottom padding:

  1.   var ipd = 'field1,field2';
  2.   console.log('Img Pad string: ' + ipd);
  3.   var ipdarray = new Array();
  4.   ipdarray = ipd.split(',');
  5.   console.log('Img Pad array split: ' + typeof ipdarray);
  6.   console.log('Img Pad array: ' , ipdarray);
  7.   for(var i = 0; i < ipdarray.length; i++) {
  8.       console.log('field: ' + ipdarray[i]);
  9.       $('.my-cell[my-field="ipdarray[i]"]').css({'padding-bottom': '0px'});
  10.   }

I think there's something wrong w/ line #11


It should change the bottom red div's padding to 0.