I have a select field with some options in it. Now I need to select one of those options with jQuery. But how can I do that when I only know the
select
options
var opt = new Option(name, id); $("#selectboxName").append(opt); opt.setAttribute("selected","selected");