homepage Welcome to WebmasterWorld Guest from 54.166.8.138
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
grabbing CSS on a jQuery object
sssweb




msg:4558246
 1:29 pm on Mar 25, 2013 (gmt 0)

I have the following function in which I'm trying to get CSS specs for various elements. One works and the other doesn't, and I don't know why.

function click(el) {
var chld = $(el).children().eq(1), dsply1 = $(chld).css("display"), dsply2 = ("#genID").css("display");
...
}

I get the value for dsply1 but not dsply2. Instead I get this error:

Object does not support property or method 'css'

 

Fotiman




msg:4558259
 2:16 pm on Mar 25, 2013 (gmt 0)

You're missing the $ before ("#genID")

sssweb




msg:4558290
 3:09 pm on Mar 25, 2013 (gmt 0)

Oy - pls excuse me while I crawl under a rock.

If only jQuery would give errors like "Hey dummy, you forgot the '$'", I wouldn't have to bug you guys so much.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved