* @test ok( $('#text1').attr('type') == "text", 'Check for type attribute' );
* @test ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );
* @test ok( $('#check1').attr('type') == "checkbox", 'Check for type attribute' );
+ * @test ok( $('#simon1').attr('rel') == "bookmark", 'Check for rel attribute' );
+ * @test ok( $('#google').attr('title') == "Google!", 'Check for title attribute' );
+ * @test ok( $('#mark').attr('hreflang') == "en", 'Check for hreflang attribute' );
+ * @test ok( $('#en').attr('lang') == "en", 'Check for lang attribute' );
+ * @test ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' );
+ * @test ok( $('#name').attr('name') == "name", 'Check for name attribute' );
*
* @name attr
* @type Object
* }
* ok( pass, "Set Attribute" );
*
+ * @test $("#name").attr('name', 'something');
+ * ok( $("#name").name() == 'something', 'Set name attribute' );
+ *
* @name attr
* @type jQuery
* @param String key The name of the property to set.
* @example $("p").css("color");
* @before <p style="color:red;">Test Paragraph.</p>
* @result red
+ * @desc Retrieves the color style of the first paragraph
+ *
+ * @example $("p").css("fontWeight");
+ * @before <p style="font-weight: bold;">Test Paragraph.</p>
+ * @result bold
+ * @desc Retrieves the font-weight style of the first paragraph.
+ * Note that for all style properties with a dash (like 'font-weight'), you have to
+ * write it in camelCase. In other words: Every time you have a '-' in a
+ * property, remove it and replace the next character with an uppercase
+ * representation of itself. Eg. fontWeight, fontSize, fontFamily, borderWidth,
+ * borderStyle, borderBottomWidth etc.
*
* @test ok( $('#foo').css("display") == 'block', 'Check for css property "display"');
*
* @example $("p").css("color","red");
* @before <p>Test Paragraph.</p>
* @result <p style="color:red;">Test Paragraph.</p>
+ * @desc Changes the color of all paragraphs to red
+ *
*
* @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');
* @test $('#foo').css('display', 'none');
* @example $("p").wrap("<div class='wrap'></div>");
* @before <p>Test Paragraph.</p>
* @result <div class='wrap'><p>Test Paragraph.</p></div>
+ *
+ * @test var defaultText = 'Try them out:'
+ * var result = $('#first').wrap('<div class="red"><span></span></div>').text();
+ * ok( defaultText == result, 'Check for simple wrapping' );
+ * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' );
*
* @test var defaultText = 'Try them out:'
- * @test var result = $('#first').wrap('<div class="red">xx<span></span>yy</div>').text()
+ * var result = $('#first').wrap('<div class="red">xx<span></span>yy</div>').text()
* ok( 'xx' + defaultText + 'yy' == result, 'Check for wrapping' );
- * @test ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' );
+ * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' );
*
* @name wrap
* @type jQuery
* @before <p class="selected">Hello</p><p>How are you?</p>
* @result $("p").filter(".selected") == [ <p class="selected">Hello</p> ]
*
+ * @test isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "Filter elements" );
+ *
* @name filter
* @type jQuery
* @param String expr An expression to search with.
* @test t( "Last Child", "p:last-child", ["sap"] );
* @test t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] );
* @test t( "Empty", "ul:empty", ["firstUL"] );
- * @test t( "Enabled UI Element", "input:enabled", ["text1","radio1","radio2","check1","check2","hidden1","hidden2"] );
+ * @test t( "Enabled UI Element", "input:enabled", ["text1","radio1","radio2","check1","check2","hidden1","hidden2","name"] );
* @test t( "Disabled UI Element", "input:disabled", ["text2"] );
* @test t( "Checked UI Element", "input:checked", ["radio2","check1"] );
* @test t( "Selected Option Element", "option:selected", ["option1a","option2d","option3b","option3c"] );
* @test t( "Position Greater Than", "p:gt(0)", ["ap","sndp","en","sap","first"] );
* @test t( "Position Less Than", "p:lt(3)", ["firstp","ap","sndp"] );
* @test t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] );
- * @test t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2"] );
+ * @test t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] );
* @test t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] );
*
* @name $.find
if ( fix[name] ) {
if ( value != undefined ) elem[fix[name]] = value;
return elem[fix[name]];
- } else if ( elem.getAttribute ) {
+ } else if ( elem.getAttribute != undefined ) {
if ( value != undefined ) elem.setAttribute( name, value );
return elem.getAttribute( name, 2 );
} else {
* @example $.map( [0,1,2], function(i){
* return [ i, i + 1 ];
* });
- * @result [0, 1, 1, 2, 2, 3]\r *
+ * @result [0, 1, 1, 2, 2, 3]
+ *
* @name $.map
* @type Array
* @param Array array The Array to translate.