How can I make jQuery select an element in the style of CSS?

Posted by ben on Stack Overflow See other posts from Stack Overflow or by ben
Published on 2010-05-31T10:47:11Z Indexed on 2010/05/31 10:52 UTC
Read the original article Hit count: 261

Filed under:
|
|

<div id="id" class="div-style"><img id="1" class="img-style"></div>

I would like to use the id attribute as a way for jQuery to select the element, and the class attribute for CSS to style it.

My guess for jQuery selector ran thusly:

$("#id .div-class")

and

$("#id .img-class")

This returns the error "Selector expected"

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about css