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:
- var ipd = 'field1,field2';
- console.log('Img Pad string: ' + ipd);
- var ipdarray = new Array();
- ipdarray = ipd.split(',');
- console.log('Img Pad array split: ' + typeof ipdarray);
- console.log('Img Pad array: ' , ipdarray);
- for(var i = 0; i < ipdarray.length; i++) {
- console.log('field: ' + ipdarray[i]);
- $('.my-cell[my-field="ipdarray[i]"]').css({'padding-bottom': '0px'});
- }
I think there's something wrong w/ line #11
It should change the bottom red div's padding to 0.