From abcc1a76ee2a6733177b2cd104bc32cee5443ec4 Mon Sep 17 00:00:00 2001 From: jeresig Date: Sat, 13 Feb 2010 02:23:38 -0500 Subject: If .attr() is run on no elements undefined should be returned (as should be the case when no attribute is found). Fixes #6012. --- src/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.js b/src/core.js index 9fa311d50..ba5d7f528 100644 --- a/src/core.js +++ b/src/core.js @@ -799,7 +799,7 @@ function access( elems, key, value, exec, fn, pass ) { } // Getting an attribute - return length ? fn( elems[0], key ) : null; + return length ? fn( elems[0], key ) : undefined; } function now() { -- cgit v1.2.3