Google Groups Home
Help | Sign in
empty class return undefined .. bug ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Adwin Wijaya  
View profile
 More options May 11, 12:48 pm
From: Adwin Wijaya <adwin.wij...@gmail.com>
Date: Sun, 11 May 2008 09:48:55 -0700 (PDT)
Local: Sun, May 11 2008 12:48 pm
Subject: empty class return undefined .. bug ?
I have code .. to check what class in every id ..

i found that if the class="", attr will return undefined ...

example: className =  $('#myid').attr('class');

I use Jquery 1.2.4b from ui.jquery.com

is it the bug or it is the correct result from attr() ?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard D. Worth  
View profile
 More options May 12, 8:01 am
From: "Richard D. Worth" <rdwo...@gmail.com>
Date: Mon, 12 May 2008 08:01:35 -0400
Local: Mon, May 12 2008 8:01 am
Subject: Re: [jQuery] empty class return undefined .. bug ?

The name of the class attribute is className, so you want:

$('#myid').attr('className');

- Richard

Richard D. Worth
http://rdworth.org/

On Sun, May 11, 2008 at 12:48 PM, Adwin Wijaya <adwin.wij...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ariel Flesler  
View profile
 More options May 12, 4:11 pm
From: Ariel Flesler <afles...@gmail.com>
Date: Mon, 12 May 2008 13:11:23 -0700 (PDT)
Local: Mon, May 12 2008 4:11 pm
Subject: Re: empty class return undefined .. bug ?
No Richard, that's a bug on jQuery.attr, undefined is returned instead
of ''.
'class' works as well as 'className'.

I hope this gets revised, it's one of the fixes of on this ticket:
  http://dev.jquery.com/ticket/2548

Cheers

--
Ariel Flesler
http://flesler.blogspot.com

On 12 mayo, 09:01, "Richard D. Worth" <rdwo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google