test("attr(String)", function() {
expect(28);
- // This one sometimes fails randomally ?!
+ // This one sometimes fails randomly ?!
equals( jQuery('#text1').attr('value'), "Test", 'Check for value attribute' );
equals( jQuery('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' );
test("attr(String, Function)", function() {
expect(2);
- equals( jQuery('#text1').attr('value', function() { return this.id })[0].value, "text1", "Set value from id" );
+ equals( jQuery('#text1').attr('value', function() { return this.id ;})[0].value, "text1", "Set value from id" );
equals( jQuery('#text1').attr('title', function(i) { return i }).attr('title'), "0", "Set value with an index");
});
});
test("attr(jquery_method)", function(){
- expect(8);
+ expect(7);
var $elem = jQuery("<div />"),
elem = $elem[0];
$elem.attr('text', 'bar');
equals( elem.innerHTML, 'bar', 'attr(text)');
- $elem.attr('addClass', 'css');
- equals( elem.className, 'css', 'attr(addClass)');
-
$elem.attr('css', {color:'red'});
ok( /^(#ff0000|red)$/i.test(elem.style.color), 'attr(css)');
var j = jQuery("#nonnodes").contents();
j.addClass( valueObj("asdf") );
ok( j.hasClass("asdf"), "Check node,textnode,comment for addClass" );
-}
+};
test("addClass(String)", function() {
testAddClass(bareObj);