$()是有兩個參數,第一個是選擇器,第二個是做用域

$()有2個參數,一個是選擇器,一個是做用域。
要和$("xxxx,xxx")區分。一般意義下的$('xxxx')實際上是默認了第二個做用域。完整說應該是$('xxxx',document)
$("#select1").dblclick(function(){
var $option=$("option:selected",this);//在select1中選擇selected的option
$option.appentTo($("#select2"));
})
相關文章
相關標籤/搜索