js コンストラクタでselect object作成

$(function(){
  var s = new Select({1:"hello1", 2:"hello2"}, changeFunc);
  s.append();
});

function Select(values, changeFunc){
  this.object = $('<select>').append($('<option>').val(0))
  for (k in values){
    this.object.append($('<option>').val(k).text(values[k]))
  }
  this.object.bind("change", changeFunc)
  this.append = function(){$('div').append(this.object)}
  $('label').text("hi")
}

function changeFunc(event){alert($(this).val())}