开发者

select box auto selected as a default

I want when adding a new item with jquery

$("#dve option").dblclick(function() {
$(this).clone().appendTo("#edno");
});

The item to be 开发者_开发百科added, as selected to the select box, how to do that ?


see jQuery.prop() in jQuery v1.6

$(this).clone().appendTo("#edno").prop('selected',true)

see also the performance between attr() and prop() here


you can use that..

$(this).clone().appendTo("#edno").attr('selected',true);

hope its work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜