jQuery: hasAttr method