I have written a jQuery to generate a dynamic drop-down list. How can I set the default text in it(Ex: Select a city)? Thanks!
Here is the script:
var ss = $('#ss');
var select = $('<select></select>').attr({ id: name, name: name });
$.each(u.Options, function (i, option) {
select.append($('<option</option>').val(option.Value).text(option.Text));
})
ss.append(select);