set HTML data attribute as an integer array

HTML code is shown below:

(function ($) { $('.afc_close_content').click(function(){ var afc_content_id = $(this).closest('div').attr('id'); $('#'+afc_content_id).hide(); }); })(jQuery);