I am trying to use jQuery's addClass() to add the class "picbox_selected" to the items in the array features, which have id numbers corresponding to the index of items in the array config. I tried the following code but it is not working.
var leftHandShape = features['Left Hand Shape']
for (i = 0; i < config.HandShapes.length; i++) {
var handName = config.HandShapes[i].Name;
if (leftHandShape == handName) {
var idNo = '.picbox id' + i
$(idNo).addClass('picbox_selected')
}
}
I tried this as well but it's not working either. Please help!
var leftHandShape = features['Left Hand Shape']
for (i = 0; i < config.HandShapes.length; i++) {
var handName = config.HandShapes[i].Name;
if (leftHandShape == handName) {
$(document).ready(function() {
$('.picbox id' + i).addClass('picbox_selected')
})
}
}