javascript - Accessing JS object value with variable -
so lets take code:
$('.show-popup').on('click', function(){ var id = $(this).data('id'); console.log(id); console.log(overlay_data[id]); }); i output:
28125 undefined if hard code value in, outputs every time. not work, if pass key via variable. how make work?
Comments
Post a Comment