Skip to main content
Active reading. [<http://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645>]
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

Using the $.map() function, you can do this in a more elegant way  :

$('#mySelect').html( $.map(selectValues, function(val, key){   return '<option value="' + val + '">'+ key + '</option>'; }).join('') ); 

Using the $.map() function, you can do this in a more elegant way  :

$('#mySelect').html( $.map(selectValues, function(val, key){   return '<option value="' + val + '">'+ key + '</option>'; }).join('') ); 

Using the $.map() function, you can do this in a more elegant way:

$('#mySelect').html( $.map(selectValues, function(val, key){ return '<option value="' + val + '">'+ key + '</option>'; }).join('')); 
added 11 characters in body
Source Link
Dr Fred
  • 989
  • 9
  • 15

Using the $.map() function, you can do this in a more elegant way :

$('#mySelect').html( $.map(selectValues, function(ival, key){ return '<option value="' + ival + '">'+ ikey + '</option>'; }).join('') ); 

Using the $.map() function, you can do this in a more elegant way :

$('#mySelect').html( $.map(selectValues, function(i){ return '<option value="' + i + '">'+ i + '</option>'; }).join('') ); 

Using the $.map() function, you can do this in a more elegant way :

$('#mySelect').html( $.map(selectValues, function(val, key){ return '<option value="' + val + '">'+ key + '</option>'; }).join('') ); 
Source Link
Dr Fred
  • 989
  • 9
  • 15

Using the $.map() function, you can do this in a more elegant way :

$('#mySelect').html( $.map(selectValues, function(i){ return '<option value="' + i + '">'+ i + '</option>'; }).join('') );