});
});
+var foo = false;
+
test("$('html')", function() {
- expect(2);
+ expect(4);
reset();
- ok( $("<script>var foo='test';</script>")[0], "Creating a script" );
+ foo = false;
+ var s = $("<script>var foo='test';</script>")[0];
+ ok( s, "Creating a script" );
+ ok( !foo, "Make sure the script wasn't executed prematurely" );
+ $("body").append(s);
+ ok( foo, "Executing a scripts contents in the right context" );
reset();
ok( $("<link rel='stylesheet'/>")[0], "Creating a link" );
});
test("val(String)", function() {
- expect(2);
+ expect(3);
document.getElementById('text1').value = "bla";
ok( $("#text1").val() == "bla", "Check for modified value of input element" );
$("#text1").val('test');
ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
+
+ $("#select1").val("3");
+ ok( $("#select1").val() == "3", "Check for modified (via val(String)) value of select element" );
});
test("html(String)", function() {