mcmega,
<!doctype html>
<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<input value="Events" class="btn w45" onclick="createAPISelect('#eve', api[0]);" type="button">
<div id="eve"></div>
<script type="text/javascript">
var api = [{ "{{e1}}":[{"{{c1}}":"1","{{c2}}":"2"}], "{{e2}}":[{"{{c3}}":"1","{{c4}}":"2","{{c5}}":"3"}] }];
function setSelect(sel,obj){
sel.options.length=0;
Object.keys(obj).forEach(function(key,k){
var value=typeof obj[key]=='object' ? key : obj[key];
// Переводчик текста option
var dicTrans = {"e1":"it1","c1":"it1.1","c2":"it1.2","e2":"it2","c3":"it2.1","c4":"it2.2","c5":"it2.3"};
var trKey = key.replace(/[\{\}]/g,"");
var text = dicTrans[trKey]||key ;
sel.options[k]=new Option(text,value);
})
}
function createAPISelect(id,obj){
var parEl=document.querySelector(id);
var select = parEl.querySelectorAll('select')
var sel = select.length ? select[0] : document.createElement('select');
sel.className='select w45';
var selTwo = select.length == 2 ? select[1] : sel.cloneNode();
setSelect(sel,obj);
parEl.appendChild(sel);
parEl.appendChild(selTwo);
function changeSelect(){setSelect(selTwo,obj[this.value][0]);}
sel.addEventListener('change',changeSelect);
changeSelect.bind(sel)();
}
</script>
</body>
</html>