From 264ffbc73be61778484a292392d1b18a8976588f Mon Sep 17 00:00:00 2001 From: David Serduke Date: Sat, 17 Nov 2007 22:09:51 +0000 Subject: [PATCH] Fixed #1074 where .html() was incorrectly changing the selected value of an option. --- src/core.js | 2 +- test/unit/core.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core.js b/src/core.js index d27dcb9f..36d736c1 100644 --- a/src/core.js +++ b/src/core.js @@ -932,7 +932,7 @@ jQuery.extend({ var wrap = // option or optgroup !tags.indexOf("", "" ] || + [ 1, "" ] || !tags.indexOf("", "" ] || diff --git a/test/unit/core.js b/test/unit/core.js index cf3a312d..18f1bb54 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -882,15 +882,19 @@ test("val(String)", function() { var scriptorder = 0; test("html(String)", function() { - expect(9); + expect(10); var div = $("div"); div.html("test"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { - if ( div.get(i).childNodes.length == 0 ) pass = false; + if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" ); + $("#main").html("