3 var bareObj = function(value) { return value; };
4 var functionReturningObj = function(value) { return (function() { return value; }); };
6 test("attr(String)", function() {
9 // This one sometimes fails randomly ?!
10 equals( jQuery('#text1').attr('value'), "Test", 'Check for value attribute' );
12 equals( jQuery('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' );
13 equals( jQuery('#text1').attr('type'), "text", 'Check for type attribute' );
14 equals( jQuery('#radio1').attr('type'), "radio", 'Check for type attribute' );
15 equals( jQuery('#check1').attr('type'), "checkbox", 'Check for type attribute' );
16 equals( jQuery('#simon1').attr('rel'), "bookmark", 'Check for rel attribute' );
17 equals( jQuery('#google').attr('title'), "Google!", 'Check for title attribute' );
18 equals( jQuery('#mark').attr('hreflang'), "en", 'Check for hreflang attribute' );
19 equals( jQuery('#en').attr('lang'), "en", 'Check for lang attribute' );
20 equals( jQuery('#simon').attr('class'), "blog link", 'Check for class attribute' );
21 equals( jQuery('#name').attr('name'), "name", 'Check for name attribute' );
22 equals( jQuery('#text1').attr('name'), "action", 'Check for name attribute' );
23 ok( jQuery('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );
24 // Temporarily disabled. See: #4299
25 // ok( jQuery('#form').attr('action','newformaction').attr('action').indexOf("newformaction") >= 0, 'Check that action attribute was changed' );
26 equals( jQuery('#text1').attr('maxlength'), '30', 'Check for maxlength attribute' );
27 equals( jQuery('#text1').attr('maxLength'), '30', 'Check for maxLength attribute' );
28 equals( jQuery('#area1').attr('maxLength'), '30', 'Check for maxLength attribute' );
29 equals( jQuery('#select2').attr('selectedIndex'), 3, 'Check for selectedIndex attribute' );
30 equals( jQuery('#foo').attr('nodeName').toUpperCase(), 'DIV', 'Check for nodeName attribute' );
31 equals( jQuery('#foo').attr('tagName').toUpperCase(), 'DIV', 'Check for tagName attribute' );
33 jQuery('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path
34 equals( jQuery('#tAnchor5').attr('href'), "#5", 'Check for non-absolute href (an anchor)' );
36 equals( jQuery("<option/>").attr("selected"), false, "Check selected attribute on disconnected element." );
39 // Related to [5574] and [5683]
40 var body = document.body, $body = jQuery(body);
42 ok( $body.attr('foo') === undefined, 'Make sure that a non existent attribute returns undefined' );
43 ok( $body.attr('nextSibling') === null, 'Make sure a null expando returns null' );
45 body.setAttribute('foo', 'baz');
46 equals( $body.attr('foo'), 'baz', 'Make sure the dom attribute is retrieved when no expando is found' );
49 equals( $body.attr('foo'), 'bar', 'Make sure the expando is preferred over the dom attribute' );
51 $body.attr('foo','cool');
52 equals( $body.attr('foo'), 'cool', 'Make sure that setting works well when both expando and dom attribute are available' );
55 ok( $body.attr('foo') === undefined, 'Make sure the expando is preferred over the dom attribute, even if undefined' );
57 body.removeAttribute('foo'); // Cleanup
59 var select = document.createElement("select"), optgroup = document.createElement("optgroup"), option = document.createElement("option");
60 optgroup.appendChild( option );
61 select.appendChild( optgroup );
63 equals( jQuery(option).attr("selected"), true, "Make sure that a single option is selected, even when in an optgroup." );
67 test("attr(String) in XML Files", function() {
70 jQuery.get("data/dashboard.xml", function(xml) {
71 equals( jQuery("locations", xml).attr("class"), "foo", "Check class attribute in XML document" );
72 equals( jQuery("location", xml).attr("for"), "bar", "Check for attribute in XML document" );
78 test("attr(String, Function)", function() {
80 equals( jQuery('#text1').attr('value', function() { return this.id ;})[0].value, "text1", "Set value from id" );
81 equals( jQuery('#text1').attr('title', function(i) { return i }).attr('title'), "0", "Set value with an index");
84 test("attr(Hash)", function() {
87 jQuery("div").attr({foo: 'baz', zoo: 'ping'}).each(function(){
88 if ( this.getAttribute('foo') != "baz" && this.getAttribute('zoo') != "ping" ) pass = false;
90 ok( pass, "Set Multiple Attributes" );
91 equals( jQuery('#text1').attr({'value': function() { return this.id; }})[0].value, "text1", "Set attribute to computed value #1" );
92 equals( jQuery('#text1').attr({'title': function(i) { return i; }}).attr('title'), "0", "Set attribute to computed value #2");
96 test("attr(String, Object)", function() {
98 var div = jQuery("div").attr("foo", "bar"),
100 for ( var i = 0; i < div.size(); i++ ) {
101 if ( div.get(i).getAttribute('foo') != "bar" ){
106 equals( fail, false, "Set Attribute, the #"+fail+" element didn't get the attribute 'foo'" );
108 // Fails on IE since recent changes to .attr()
109 // ok( jQuery("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
111 jQuery("#name").attr('name', 'something');
112 equals( jQuery("#name").attr('name'), 'something', 'Set name attribute' );
113 jQuery("#check2").attr('checked', true);
114 equals( document.getElementById('check2').checked, true, 'Set checked attribute' );
115 jQuery("#check2").attr('checked', false);
116 equals( document.getElementById('check2').checked, false, 'Set checked attribute' );
117 jQuery("#text1").attr('readonly', true);
118 equals( document.getElementById('text1').readOnly, true, 'Set readonly attribute' );
119 jQuery("#text1").attr('readonly', false);
120 equals( document.getElementById('text1').readOnly, false, 'Set readonly attribute' );
121 jQuery("#name").attr('maxlength', '5');
122 equals( document.getElementById('name').maxLength, '5', 'Set maxlength attribute' );
123 jQuery("#name").attr('maxLength', '10');
124 equals( document.getElementById('name').maxLength, '10', 'Set maxlength attribute' );
126 var table = jQuery('#table').append("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>"),
127 td = table.find('td:first');
128 td.attr("rowspan", "2");
129 equals( td[0].rowSpan, 2, "Check rowspan is correctly set" );
130 td.attr("colspan", "2");
131 equals( td[0].colSpan, 2, "Check colspan is correctly set" );
132 table.attr("cellspacing", "2");
133 equals( table[0].cellSpacing, 2, "Check cellspacing is correctly set" );
136 jQuery("#name").attr('someAttr', '0');
137 equals( jQuery("#name").attr('someAttr'), '0', 'Set attribute to a string of "0"' );
138 jQuery("#name").attr('someAttr', 0);
139 equals( jQuery("#name").attr('someAttr'), 0, 'Set attribute to the number 0' );
140 jQuery("#name").attr('someAttr', 1);
141 equals( jQuery("#name").attr('someAttr'), 1, 'Set attribute to the number 1' );
143 // using contents will get comments regular, text, and comment nodes
144 var j = jQuery("#nonnodes").contents();
146 j.attr("name", "attrvalue");
147 equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" );
148 j.removeAttr("name");
152 var type = jQuery("#check2").attr('type');
155 jQuery("#check2").attr('type','hidden');
159 ok( thrown, "Exception thrown when trying to change type property" );
160 equals( type, jQuery("#check2").attr('type'), "Verify that you can't change the type of an input element" );
162 var check = document.createElement("input");
165 jQuery(check).attr('type','checkbox');
169 ok( thrown, "Exception thrown when trying to change type property" );
170 equals( "checkbox", jQuery(check).attr('type'), "Verify that you can change the type of an input element that isn't in the DOM" );
172 var check = jQuery("<input />");
175 check.attr('type','checkbox');
179 ok( thrown, "Exception thrown when trying to change type property" );
180 equals( "checkbox", check.attr('type'), "Verify that you can change the type of an input element that isn't in the DOM" );
182 var button = jQuery("#button");
185 button.attr('type','submit');
189 ok( thrown, "Exception thrown when trying to change type property" );
190 equals( "button", button.attr('type'), "Verify that you can't change the type of a button element" );
193 test("attr(jquery_method)", function(){
196 var $elem = jQuery("<div />"),
200 $elem.attr({'html': 'foo'}, true);
201 equals( elem.innerHTML, 'foo', 'attr(html)');
203 $elem.attr({'text': 'bar'}, true);
204 equals( elem.innerHTML, 'bar', 'attr(text)');
206 $elem.attr({'css': {color:'red'}}, true);
207 ok( /^(#ff0000|red)$/i.test(elem.style.color), 'attr(css)');
209 $elem.attr({'height': 10}, true);
210 equals( elem.style.height, '10px', 'attr(height)');
212 // Multiple attributes
216 css:{ paddingLeft:1, paddingRight:1 }
219 equals( elem.style.width, '10px', 'attr({...})');
220 equals( elem.style.paddingLeft, '1px', 'attr({...})');
221 equals( elem.style.paddingRight, '1px', 'attr({...})');
225 test("attr(String, Object) - Loaded via XML document", function() {
228 jQuery.get('data/dashboard.xml', function(xml) {
230 jQuery('tab', xml).each(function() {
231 titles.push(jQuery(this).attr('title'));
233 equals( titles[0], 'Location', 'attr() in XML context: Check first title' );
234 equals( titles[1], 'Users', 'attr() in XML context: Check second title' );
240 test("attr('tabindex')", function() {
243 // elements not natively tabbable
244 equals(jQuery('#listWithTabIndex').attr('tabindex'), 5, 'not natively tabbable, with tabindex set to 0');
245 equals(jQuery('#divWithNoTabIndex').attr('tabindex'), undefined, 'not natively tabbable, no tabindex set');
248 equals(jQuery('#linkWithNoTabIndex').attr('tabindex'), 0, 'anchor with href, no tabindex set');
249 equals(jQuery('#linkWithTabIndex').attr('tabindex'), 2, 'anchor with href, tabindex set to 2');
250 equals(jQuery('#linkWithNegativeTabIndex').attr('tabindex'), -1, 'anchor with href, tabindex set to -1');
252 // anchor without href
253 equals(jQuery('#linkWithNoHrefWithNoTabIndex').attr('tabindex'), undefined, 'anchor without href, no tabindex set');
254 equals(jQuery('#linkWithNoHrefWithTabIndex').attr('tabindex'), 1, 'anchor without href, tabindex set to 2');
255 equals(jQuery('#linkWithNoHrefWithNegativeTabIndex').attr('tabindex'), -1, 'anchor without href, no tabindex set');
258 test("attr('tabindex', value)", function() {
261 var element = jQuery('#divWithNoTabIndex');
262 equals(element.attr('tabindex'), undefined, 'start with no tabindex');
264 // set a positive string
265 element.attr('tabindex', '1');
266 equals(element.attr('tabindex'), 1, 'set tabindex to 1 (string)');
269 element.attr('tabindex', '0');
270 equals(element.attr('tabindex'), 0, 'set tabindex to 0 (string)');
272 // set a negative string
273 element.attr('tabindex', '-1');
274 equals(element.attr('tabindex'), -1, 'set tabindex to -1 (string)');
276 // set a positive number
277 element.attr('tabindex', 1);
278 equals(element.attr('tabindex'), 1, 'set tabindex to 1 (number)');
281 element.attr('tabindex', 0);
282 equals(element.attr('tabindex'), 0, 'set tabindex to 0 (number)');
284 // set a negative number
285 element.attr('tabindex', -1);
286 equals(element.attr('tabindex'), -1, 'set tabindex to -1 (number)');
288 element = jQuery('#linkWithTabIndex');
289 equals(element.attr('tabindex'), 2, 'start with tabindex 2');
291 element.attr('tabindex', -1);
292 equals(element.attr('tabindex'), -1, 'set negative tabindex');
295 test("removeAttr(String)", function() {
297 equals( jQuery('#mark').removeAttr( "class" )[0].className, "", "remove class" );
300 test("val()", function() {
303 document.getElementById('text1').value = "bla";
304 equals( jQuery("#text1").val(), "bla", "Check for modified value of input element" );
308 equals( jQuery("#text1").val(), "Test", "Check for value of input element" );
309 // ticket #1714 this caused a JS error in IE
310 equals( jQuery("#first").val(), "", "Check a paragraph element to see if it has a value" );
311 ok( jQuery([]).val() === undefined, "Check an empty jQuery object will return undefined from val" );
313 equals( jQuery('#select2').val(), '3', 'Call val() on a single="single" select' );
315 same( jQuery('#select3').val(), ['1', '2'], 'Call val() on a multiple="multiple" select' );
317 equals( jQuery('#option3c').val(), '2', 'Call val() on a option element with value' );
319 equals( jQuery('#option3a').val(), '', 'Call val() on a option element with empty value' );
321 equals( jQuery('#option3e').val(), 'no value', 'Call val() on a option element with no value attribute' );
323 equals( jQuery('#option3a').val(), '', 'Call val() on a option element with no value attribute' );
325 jQuery('#select3').val("");
326 same( jQuery('#select3').val(), [''], 'Call val() on a multiple="multiple" select' );
328 var checks = jQuery("<input type='checkbox' name='test' value='1'/>").appendTo("#form")
329 .add( jQuery("<input type='checkbox' name='test' value='2'/>").appendTo("#form") )
330 .add( jQuery("<input type='checkbox' name='test' value=''/>").appendTo("#form") )
331 .add( jQuery("<input type='checkbox' name='test'/>").appendTo("#form") );
333 same( checks.serialize(), "", "Get unchecked values." );
335 equals( checks.eq(3).val(), "on", "Make sure a value of 'on' is provided if none is specified." );
338 same( checks.serialize(), "test=2", "Get a single checked value." );
340 checks.val([ "1", "" ]);
341 same( checks.serialize(), "test=1&test=", "Get multiple checked values." );
343 checks.val([ "", "2" ]);
344 same( checks.serialize(), "test=2&test=", "Get multiple checked values." );
346 checks.val([ "1", "on" ]);
347 same( checks.serialize(), "test=1&test=on", "Get multiple checked values." );
352 var testVal = function(valueObj) {
355 jQuery("#text1").val(valueObj( 'test' ));
356 equals( document.getElementById('text1').value, "test", "Check for modified (via val(String)) value of input element" );
358 jQuery("#text1").val(valueObj( 67 ));
359 equals( document.getElementById('text1').value, "67", "Check for modified (via val(Number)) value of input element" );
361 jQuery("#select1").val(valueObj( "3" ));
362 equals( jQuery("#select1").val(), "3", "Check for modified (via val(String)) value of select element" );
364 jQuery("#select1").val(valueObj( 2 ));
365 equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" );
367 jQuery("#select1").append("<option value='4'>four</option>");
368 jQuery("#select1").val(valueObj( 4 ));
369 equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" );
371 // using contents will get comments regular, text, and comment nodes
372 var j = jQuery("#nonnodes").contents();
373 j.val(valueObj( "asdf" ));
374 equals( j.val(), "asdf", "Check node,textnode,comment with val()" );
375 j.removeAttr("value");
378 test("val(String/Number)", function() {
382 test("val(Function)", function() {
383 testVal(functionReturningObj);
386 test("val(Function) with incoming value", function() {
389 var oldVal = jQuery("#text1").val();
391 jQuery("#text1").val(function(i, val) {
392 equals( val, oldVal, "Make sure the incoming value is correct." );
396 equals( document.getElementById('text1').value, "test", "Check for modified (via val(String)) value of input element" );
398 oldVal = jQuery("#text1").val();
400 jQuery("#text1").val(function(i, val) {
401 equals( val, oldVal, "Make sure the incoming value is correct." );
405 equals( document.getElementById('text1').value, "67", "Check for modified (via val(Number)) value of input element" );
407 oldVal = jQuery("#select1").val();
409 jQuery("#select1").val(function(i, val) {
410 equals( val, oldVal, "Make sure the incoming value is correct." );
414 equals( jQuery("#select1").val(), "3", "Check for modified (via val(String)) value of select element" );
416 oldVal = jQuery("#select1").val();
418 jQuery("#select1").val(function(i, val) {
419 equals( val, oldVal, "Make sure the incoming value is correct." );
423 equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" );
425 jQuery("#select1").append("<option value='4'>four</option>");
427 oldVal = jQuery("#select1").val();
429 jQuery("#select1").val(function(i, val) {
430 equals( val, oldVal, "Make sure the incoming value is correct." );
434 equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" );
437 var testAddClass = function(valueObj) {
439 var div = jQuery("div");
440 div.addClass( valueObj("test") );
442 for ( var i = 0; i < div.size(); i++ ) {
443 if ( div.get(i).className.indexOf("test") == -1 ) pass = false;
445 ok( pass, "Add Class" );
447 // using contents will get regular, text, and comment nodes
448 var j = jQuery("#nonnodes").contents();
449 j.addClass( valueObj("asdf") );
450 ok( j.hasClass("asdf"), "Check node,textnode,comment for addClass" );
453 test("addClass(String)", function() {
454 testAddClass(bareObj);
457 test("addClass(Function)", function() {
458 testAddClass(functionReturningObj);
461 test("addClass(Function) with incoming value", function() {
464 var div = jQuery("div"), old = div.map(function(){
465 return jQuery(this).attr("class");
468 div.addClass(function(i, val) {
469 equals( val, old[i], "Make sure the incoming value is correct." );
474 for ( var i = 0; i < div.size(); i++ ) {
475 if ( div.get(i).className.indexOf("test") == -1 ) pass = false;
477 ok( pass, "Add Class" );
480 var testRemoveClass = function(valueObj) {
483 var $divs = jQuery('div');
485 $divs.addClass("test").removeClass( valueObj("test") );
487 ok( !$divs.is('.test'), "Remove Class" );
490 $divs = jQuery('div');
492 $divs.addClass("test").addClass("foo").addClass("bar");
493 $divs.removeClass( valueObj("test") ).removeClass( valueObj("bar") ).removeClass( valueObj("foo") );
495 ok( !$divs.is('.test,.bar,.foo'), "Remove multiple classes" );
498 $divs = jQuery('div');
500 // Make sure that a null value doesn't cause problems
501 $divs.eq(0).addClass("test").removeClass( valueObj(null) );
502 ok( $divs.eq(0).is('.test'), "Null value passed to removeClass" );
504 $divs.eq(0).addClass("test").removeClass( valueObj("") );
505 ok( $divs.eq(0).is('.test'), "Empty string passed to removeClass" );
507 // using contents will get regular, text, and comment nodes
508 var j = jQuery("#nonnodes").contents();
509 j.removeClass( valueObj("asdf") );
510 ok( !j.hasClass("asdf"), "Check node,textnode,comment for removeClass" );
513 test("removeClass(String) - simple", function() {
514 testRemoveClass(bareObj);
517 test("removeClass(Function) - simple", function() {
518 testRemoveClass(functionReturningObj);
521 test("removeClass(Function) with incoming value", function() {
524 var $divs = jQuery('div').addClass("test"), old = $divs.map(function(){
525 return jQuery(this).attr("class");
528 $divs.removeClass(function(i, val) {
529 equals( val, old[i], "Make sure the incoming value is correct." );
533 ok( !$divs.is('.test'), "Remove Class" );
538 var testToggleClass = function(valueObj) {
541 var e = jQuery("#firstp");
542 ok( !e.is(".test"), "Assert class not present" );
543 e.toggleClass( valueObj("test") );
544 ok( e.is(".test"), "Assert class present" );
545 e.toggleClass( valueObj("test") );
546 ok( !e.is(".test"), "Assert class not present" );
548 // class name with a boolean
549 e.toggleClass( valueObj("test"), false );
550 ok( !e.is(".test"), "Assert class not present" );
551 e.toggleClass( valueObj("test"), true );
552 ok( e.is(".test"), "Assert class present" );
553 e.toggleClass( valueObj("test"), false );
554 ok( !e.is(".test"), "Assert class not present" );
556 // multiple class names
557 e.addClass("testA testB");
558 ok( (e.is(".testA.testB")), "Assert 2 different classes present" );
559 e.toggleClass( valueObj("testB testC") );
560 ok( (e.is(".testA.testC") && !e.is(".testB")), "Assert 1 class added, 1 class removed, and 1 class kept" );
561 e.toggleClass( valueObj("testA testC") );
562 ok( (!e.is(".testA") && !e.is(".testB") && !e.is(".testC")), "Assert no class present" );
564 // toggleClass storage
566 ok( e.get(0).className === "", "Assert class is empty (data was empty)" );
567 e.addClass("testD testE");
568 ok( e.is(".testD.testE"), "Assert class present" );
570 ok( !e.is(".testD.testE"), "Assert class not present" );
571 ok( e.data('__className__') === 'testD testE', "Assert data was stored" );
573 ok( e.is(".testD.testE"), "Assert class present (restored from data)" );
574 e.toggleClass(false);
575 ok( !e.is(".testD.testE"), "Assert class not present" );
577 ok( e.is(".testD.testE"), "Assert class present (restored from data)" );
579 e.toggleClass(false);
581 ok( e.is(".testD.testE"), "Assert class present (restored from data)" );
586 e.removeClass("testD");
587 e.removeData('__className__');
590 test("toggleClass(String|boolean|undefined[, boolean])", function() {
591 testToggleClass(bareObj);
594 test("toggleClass(Function[, boolean])", function() {
595 testToggleClass(functionReturningObj);
598 test("toggleClass(Fucntion[, boolean]) with incoming value", function() {
601 var e = jQuery("#firstp"), old = e.attr("class");
602 ok( !e.is(".test"), "Assert class not present" );
604 e.toggleClass(function(i, val) {
605 equals( val, old, "Make sure the incoming value is correct." );
608 ok( e.is(".test"), "Assert class present" );
610 old = e.attr("class");
612 e.toggleClass(function(i, val) {
613 equals( val, old, "Make sure the incoming value is correct." );
616 ok( !e.is(".test"), "Assert class not present" );
618 old = e.attr("class");
620 // class name with a boolean
621 e.toggleClass(function(i, val, state) {
622 equals( val, old, "Make sure the incoming value is correct." );
623 equals( state, false, "Make sure that the state is passed in." );
626 ok( !e.is(".test"), "Assert class not present" );
628 old = e.attr("class");
630 e.toggleClass(function(i, val, state) {
631 equals( val, old, "Make sure the incoming value is correct." );
632 equals( state, true, "Make sure that the state is passed in." );
635 ok( e.is(".test"), "Assert class present" );
637 old = e.attr("class");
639 e.toggleClass(function(i, val, state) {
640 equals( val, old, "Make sure the incoming value is correct." );
641 equals( state, false, "Make sure that the state is passed in." );
644 ok( !e.is(".test"), "Assert class not present" );
647 e.removeClass("test");
648 e.removeData('__className__');
651 test("addClass, removeClass, hasClass", function() {
654 var jq = jQuery("<p>Hi</p>"), x = jq[0];
657 equals( x.className, "hi", "Check single added class" );
659 jq.addClass("foo bar");
660 equals( x.className, "hi foo bar", "Check more added classes" );
663 equals( x.className, "", "Remove all classes" );
665 jq.addClass("hi foo bar");
666 jq.removeClass("foo");
667 equals( x.className, "hi bar", "Check removal of one class" );
669 ok( jq.hasClass("hi"), "Check has1" );
670 ok( jq.hasClass("bar"), "Check has2" );
672 var jq = jQuery("<p class='class1\nclass2\tcla.ss3\n'></p>");
673 ok( jq.hasClass("class1"), "Check hasClass with carriage return" );
674 ok( jq.is(".class1"), "Check is with carriage return" );
675 ok( jq.hasClass("class2"), "Check hasClass with tab" );
676 ok( jq.is(".class2"), "Check is with tab" );
677 ok( jq.hasClass("cla.ss3"), "Check hasClass with dot" );
679 jq.removeClass("class2");
680 ok( jq.hasClass("class2")==false, "Check the class has been properly removed" );
681 jq.removeClass("cla");
682 ok( jq.hasClass("cla.ss3"), "Check the dotted class has not been removed" );
683 jq.removeClass("cla.ss3");
684 ok( jq.hasClass("cla.ss3")==false, "Check the dotted class has been removed" );