<option>Dodatkowa opcja</option>
do wysuwanej listy <select>
Można zrobić to tak:
$.each(selectValues, function(key, value){
$('#mySelect').
append($("").
attr("value",key).
text(value));
});
albo lepiej:
var thisValue = 12;
var thisText = 'December';
var thisOpt = document.createElement('option');
thisOpt.value = thisValue;
thisOpt.appendChild(document.createTextNode(thisText));
$("#name_select_field").append(thisOpt);
Albo jak człowiek:
OdpowiedzUsuń$('#mySelect').append('' + text + '');