Interested in new_select(..., массив)
, what's wrong with the array? The function does not work with it at all. If you remove it and substitute a number for it, for example, it will work. new_select('sel1', 2)
function new_select(id, obj) { array_s = obj; array_int = document.getElementById(id); for(i = 1; i <= array_s.length; i++) { var array_value = array_s[i][1]; var array_text = array_s[i][2]; } array_int.innerHTML = '\ <div class="select">\ <div id="t'+id+'" class="select_title">Выберите тип</div>\ <div id="s'+id+'" class="selector">\ <div class="selector_img"></div>\ </div>\ <div id="l'+id+'" class="select_list">\ ad <br />asdasd <br> asd <br />\ </div>\ </div>'; var summ_width = $('#t'+id).width() + $('#s'+id).width() + 63; $('#l'+id).css('width', summ_width); } new_select('sel1', [[0, 'Выберите тип'], [1, 'Один'], [2, 'Два']]);