Grow your CSS skills. Land your dream job.

How to get the height of a div that has no id but multiple classes?

  • # January 7, 2013 at 3:52 am

    I need to get the height of a div that has three class namely a , b, c
    i.e. `

    `

    I tried using `$(‘a b c’).height();` but this returns null.

    I need to use Jquery for this. Solution using only JS is also welcomed.

    # January 7, 2013 at 3:55 am

    the $() accepts a css selector. So you would target it with:

    $(‘.a.b.c’).height();

    # January 7, 2013 at 6:20 am

    Thanks jamy_Za

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".