我用jQuery选择默认选择
$("#dve option").dblclick(function() {
$(this).clone().appendTo("#edno");
});
要添加的项目添加一个新的项目时要框汽车,作为选择的选择框,该怎么做?
我用jQuery选择默认选择
$("#dve option").dblclick(function() {
$(this).clone().appendTo("#edno");
});
要添加的项目添加一个新的项目时要框汽车,作为选择的选择框,该怎么做?
看到jQuery.prop()
在的jQuery V1.6
$(this).clone().appendTo("#edno").prop('selected',true)
也看到attr()
和prop()
之间的性能here
它说给没有方法支柱道具错误 – gambozygame 2011-05-27 07:48:08
道具方法在'jQuery v1.6中引入;'遗憾忘记提及它 – diEcho 2011-05-27 08:04:43
你可以使用..
$(this).clone().appendTo("#edno").attr('selected',true);
希望其工作
@gameboyzgame;看到我的更新 – diEcho 2011-05-27 08:12:04
@gameboyzgame plz upvote如果它是值得的:) – diEcho 2011-05-27 08:26:49