I've looked at multiple questions in search for an answer however to no avail, I'm trying to obtain the variable from a parent function and passing it like "a(b)" doesn't seem to work
I cannot for the life of me obtain 'item_classes', is there another way in which I can write my code in order for it to be operable
$(document).ready(function () {
$('.nm-more').hover(function () {
var item_num = $(this).data('stg-id');
var item_names = $(this).data('stg-items');
var item_classes = $(this).data('stg-class');
item_names.forEach(function (entry) {
var item_index = item_classes[entry];
alert(entry + ' ' + item_index);
});});
});
});
Here is a jsfiddle http://jsfiddle.net/bgzkge65/25/
item_classesanditem_namescontain? Could you give us a little more context?data-attribute? Am I correct?