0
I’ve seen several posts about it, but none of them were able to help me definitively.
I want to put an option Selected dynamically(db data).
obj.nome = [vitor,joao,carlos]
dep_option += '<option name ='+obj.nome+'>'+obj.nome+'</option>';
dep_select = '<select name="select_'+obj.nome+'">'+dep_option+'</select>';
$('body').html(dep_select).show();
So how I put the Joao option as Selected.
I appreciate the help.
Instead of you using
name
in theoption
, should wearvalue
, which would be the value of the respectiveoption
.– Sam