Hello I have a problem with this code:
for(var element in partsListById)
{
$('.title#'+partsListById[element]).on('click touch', function(e){
$('.part#'+partsListById[element]).slideToggle();
});
}
the partsListById array contains a string list of the name of the objects I want to target.
I don't understand why the code above doesn't work and this one works:
$('.title#sensor').on('click touch', function(e){
$('.part#sensor').slideToggle();
});
Where is my mistake?
I'm realy new in JS.
Can you help me?
Thank you