src/bind.js
function form(bind, el, param, value) {
  var node = element('input');

  for (var key in param) {
    if (key !== 'signal' && key !== 'element') {
      node.setAttribute(key === 'input' ? 'type' : key, param[key]);
    }
  }
  node.setAttribute('name', param.signal);
  node.value = value;

  el.appendChild(node);

  node.addEventListener('input', function() {
    bind.update(node.value);
  });

  bind.elements = [node];
  bind.set = function(value) { node.value = value; };
}
function form(bind, el, param, value) {
  var node = element('input');

  for (var key in param) {
    if (key !== 'signal' && key !== 'element') {
      node.setAttribute(key === 'input' ? 'type' : key, param[key]);
    }
  }
  node.setAttribute('name', param.signal);
  node.value = value;

  el.appendChild(node);

  node.addEventListener('input', function() {
    bind.update(node.value);
  });

  bind.elements = [node];
  bind.set = function(value) { node.value = value; };
}
function form ( bind , el , param , value ) { var node = element ( 'input' ) ; for ( var key in param ) { if ( key !== 'signal' && key !== 'element' ) { node . setAttribute ( key === 'input' ? 'type' : key , param [ key ] ) ; } } node . setAttribute ( 'name' , param . signal ) ; node . value = value ; el . appendChild ( node ) ; node . addEventListener ( 'input' , function ( ) { bind . update ( node . value ) ; } ) ; bind . elements = [ node ] ; bind . set = function ( value ) { node . value = value ; } ; }
Generates an arbitrary input form element.
The input type is controlled via user-provided parameters.
Generates an arbitrary input form element . The input type is controlled via user - provided parameters .