I have a listbox that’s populated by jQuery & JSON like this:
$(function(){
$.getJSON("jsonulmeu.php", function(j){
var options = 'Selectati valoare';
for (var i = 0; i < j.length; i++) {
options += '<option selected value="' + j[i].idx + '">' + j[i].txt + '</option>';
}
$("select#listbox").html(options);
});
});
When it displays the pointer is at the last row in list. How can I “rewind”, and make the listbox start with the first value?
1 Answer