src/bind.js
function select(bind, el, param, value) {
  var node = element('select', {name: param.signal});

  param.options.forEach(function(option) {
    var attr = {value: option};
    if (valuesEqual(option, value)) attr.selected = true;
    node.appendChild(element('option', attr, option+''));
  });

  el.appendChild(node);

  node.addEventListener('change', function() {
    bind.update(param.options[node.selectedIndex]);
  });

  bind.elements = [node];
  bind.set = function(value) {
    for (var i=0, n=param.options.length; i<n; ++i) {
      if (valuesEqual(param.options[i], value)) {
        node.selectedIndex = i; return;
      }
    }
  };
}
function select(bind, el, param, value) {
  var node = element('select', {name: param.signal});

  param.options.forEach(function(option) {
    var attr = {value: option};
    if (valuesEqual(option, value)) attr.selected = true;
    node.appendChild(element('option', attr, option+''));
  });

  el.appendChild(node);

  node.addEventListener('change', function() {
    bind.update(param.options[node.selectedIndex]);
  });

  bind.elements = [node];
  bind.set = function(value) {
    for (var i=0, n=param.options.length; i<n; ++i) {
      if (valuesEqual(param.options[i], value)) {
        node.selectedIndex = i; return;
      }
    }
  };
}
function select ( bind , el , param , value ) { var node = element ( 'select' , { name : param . signal } ) ; param . options . forEach ( function ( option ) { var attr = { value : option } ; if ( valuesEqual ( option , value ) ) attr . selected = true ; node . appendChild ( element ( 'option' , attr , option + '' ) ) ; } ) ; el . appendChild ( node ) ; node . addEventListener ( 'change' , function ( ) { bind . update ( param . options [ node . selectedIndex ] ) ; } ) ; bind . elements = [ node ] ; bind . set = function ( value ) { for ( var i = 0 , n = param . options . length ; i < n ; ++ i ) { if ( valuesEqual ( param . options [ i ] , value ) ) { node . selectedIndex = i ; return ; } } } ; }
Generates a selection list input element.
Generates a selection list input element .