Having trouble accessing the dynamically generated ID in jQuery? It seems to work fine in JavaScript but not in jQuery. Here's an example of the issue:
My jQuery code:
var img = $("#MAP"+current_img_height);
$("#map").css({'height': img.height + "px"});
My JavaScript code:
var img = document.getElementById("MAP" + current_img_height);
$("#map").css({'height': img.height + "px"});
Can you spot any issues with my jQuery code and how can I successfully access the dynamic ID? Any assistance would be greatly appreciated.