formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
- if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
- return elem.getAttribute( name );
- }
ret = elem.getAttributeNode( name );
// Return undefined if nodeValue is empty string
return ret && ret.nodeValue !== "" ?
});
test("attr(String, Object)", function() {
- expect(58);
+ expect(59);
var div = jQuery("div").attr("foo", "bar"),
fail = false;
table.attr("cellspacing", "2");
equals( table[0].cellSpacing, "2", "Check cellspacing is correctly set" );
+ equals( jQuery("#area1").attr("value"), undefined, "Value attribute retrieved correctly on textarea." );
+
// for #1070
jQuery("#name").attr("someAttr", "0");
equals( jQuery("#name").attr("someAttr"), "0", "Set attribute to a string of \"0\"" );