JSFiddle - React, Tailwind, and code Playground

JavaScript

var postCodes = [{countryCode:"US", regionCode:"NAmerica"},{countryCode:"CHN" ,regionCode:"ASIA"}, {countryCode:"CAN", regionCode:"NAmerica"}];

for(var i=0; i<postCodes.length; i++){
$('<button />', {'text':postCodes[i].countryCode})
                .click( function () {
            console.log($(this).data('postCode'));
       }).appendTo('body').data('postCode', postCodes[i]);
}