JSFiddle - React, Tailwind, and code Playground
by Johan Muller
HTML
<script>
var currencyBox = [
{
'name':'United States Dollar',
'code':'USD',
'value':'64.05'
},
{
'name':'Euro',
'code':'EUR',
'value':'70.95'
},
{
'name':'Great Britain Pounds',
'code':'GBP',
'value':'83.14'
}
];
</script>
<div class="currency-box"></div>
JavaScript
var currencyBox = function(){
var $box = $('.currency-box');
var currApp = {
'init':function(){
currApp.constructMarkup();
},
'constructMarkup':function(){
var template = '';
$.each(currencyBox,function(i,thisCurrency){
template += currApp.constructMarkupTemplate(thisCurrency);
});
$box.html(template);
},
'constructMarkupTemplate':function(tc){
return 123;
}
};
currApp.init();
};
currencyBox();