aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrandon Aaron <brandon.aaron@gmail.com>2007-04-25 18:19:39 +0000
committerBrandon Aaron <brandon.aaron@gmail.com>2007-04-25 18:19:39 +0000
commitcb828f3dab6ec8439ac111246346a8d4b3205fed (patch)
tree34d0c9205263795b7c9dc10871b4f4d8b58b10ca /src
parent2897b1bd2383031b6764192dc1ccb1d1205139a3 (diff)
downloadjquery-cb828f3dab6ec8439ac111246346a8d4b3205fed.tar.gz
jquery-cb828f3dab6ec8439ac111246346a8d4b3205fed.zip
Fix for #1087: Using appendTo with select elements
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js6
-rw-r--r--src/jquery/jquery.js6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 049c4cc97..05fd026d7 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -356,7 +356,7 @@ test("wrap(String|Element)", function() {
});
test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
- expect(12);
+ expect(13);
var defaultText = 'Try them out:'
var result = $('#first').append('<b>buga</b>');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -404,6 +404,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
ok( pass, "Test for appending a DOM node to the contents of an IFrame" );
+ reset();
+ $('#select1').appendTo('#foo');
+ t( 'Append select', '#foo select', ['select1'] );
+
});
test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 5347c9265..885986789 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1525,10 +1525,10 @@ jQuery.extend({
arg = jQuery.makeArray( div.childNodes );
}
- if ( arg.length === 0 && !jQuery.nodeName(arg, "form") )
+ if ( arg.length === 0 && !jQuery(arg).is("form, select") )
return;
-
- if ( arg[0] == undefined || jQuery.nodeName(arg, "form") )
+
+ if ( arg[0] == undefined || jQuery(arg).is("form, select") )
r.push( arg );
else
r = jQuery.merge( r, arg );