semantic.js
function(response, fields) {
    var
      values = response[fields.values] || {},
      html   = ''
    ;
    $.each(values, function(index, option) {
      var
        maybeText = (option[fields.text])
          ? 'data-text="' + option[fields.text] + '"'
          : '',
        maybeDisabled = (option[fields.disabled])
          ? 'disabled '
          : ''
      ;
      html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>';
      html +=   option[fields.name];
      html += '</div>';
    });
    return html;
  }
function(response, fields) {
    var
      values = response[fields.values] || {},
      html   = ''
    ;
    $.each(values, function(index, option) {
      var
        maybeText = (option[fields.text])
          ? 'data-text="' + option[fields.text] + '"'
          : '',
        maybeDisabled = (option[fields.disabled])
          ? 'disabled '
          : ''
      ;
      html += '<div class="'+ maybeDisabled +'item" data-value="' + option[fields.value] + '"' + maybeText + '>';
      html +=   option[fields.name];
      html += '</div>';
    });
    return html;
  }
function ( response , fields ) { var values = response [ fields . values ] || { } , html = '' ; $ . each ( values , function ( index , option ) { var maybeText = ( option [ fields . text ] ) ? 'data-text="' + option [ fields . text ] + '"' : '' , maybeDisabled = ( option [ fields . disabled ] ) ? 'disabled ' : '' ; html += '<div class="' + maybeDisabled + 'item" data-value="' + option [ fields . value ] + '"' + maybeText + '>' ; html += option [ fields . name ] ; html += '</div>' ; } ) ; return html ; }
generates just menu from select
generates just menu from select