Código Javascript:
Ver original
var WindowIndex = new Class ({ initialize:function (width,_size,items) { this.items = [] with (this.insertOption = $C('option')) { innerHTML = "Insertar..." } with (this.insertSelect = $C("select")) { setAttribute("class","box-index") appendChild(this.insertOption) for (var i in items ) { var item = items[i] with (this.items[item[0]] = $C('option')) { value = item[0] innerHTML = item[1] } appendChild(this.items[item[0]]) } style.width = width + "px" } this.insertSelect.addEventListener("change",function () { alert("deberia suceder algo") }) with (this.itemSelector = $C("select")) { setAttribute("class","box-index-selector") style.width = width + "px" size = _size } with (this.object = $C("div")) { style.float = "left" style.marginRight = "5px" appendChild(this.insertSelect) appendChild(this.itemSelector) } } })
NOTA: $C(): crea un objeto DOM