How to get the complete css information if css class is given form the used style sheets files

Tags: javascript,jquery,css,firebug,stylesheet

Problem :

I want to find the complete css information of applied class in details by clicking on it. Like

<div class="class1 class2">This is my div</div>

Suppose I've written css in xyz.css file



After clicking on the div I want to display all the css information which is applied to the div. jQuery solution will be preferred.

As per first few answers I'm getting all the computed style but I'm interested in my only applied class style details.

Solution :

You can get the current style of an element with this:

var elem = ...;
var css = document.defaultView ? document.defaultView.getComputedStyle(elem, null) : elem.currentStyle;

if ('length' in css) {
    // iterate over all property names
    for (var i = 0, l = css.length; i < l; ++i) {
        var propertyName = css[i];
        // get property value
        var value = css[propertyName];
        if (value != void 0) {
            console.log(propertyName+': '+value);
} else {
    // IE
    for (var propertyName in css) {
        // get property value
        var value = css[propertyName];
        if (value != void 0) {
            console.log(propertyName+': '+value);

Try this here:

You may also whant to try with document.styleSheets ( see )

    CSS Howto..

    How to animate a div when another div is clicked and how to make the animated div move other elements

    how to give conditional comments in firefox for a single css style statement

    How do you transition a height without the element going outside the parents border?

    How to display results comming from database in 3 columns using php/mysql/html/css

    How to set a style one a parent element [duplicate]

    How to fill the anchor element's height to 100% in html?

    Jquery Mobile dynamic thumbnail list-How to create a border?

    How to use Custom Fonts using CSS?

    How to select via regex all class notations in css file

    How do I install and use Groundwork CSS

    How do I move the background image of a DIV based on the scrollbar movement?

    How to set margin for elements in my case

    How to implement the button css like Spotify play button in the table row

    How can I mimic Leaflet.Draw tooltip style with a different tooltip plugin?

    how to create 100% vertical line in css

    How to fit a big picture in a smaller space

    How generate width html element to fill rest of width window

    How do I change tab size in Vim?

    How to make an html section right justified and shift to a new row if the window is narrow?

    Using pure Javascript to show contents of list on click only on mobile and show initially on desktop

    How to Use IF Statement in Play Framework to Use CSS for Only 1 Page

    How to “mark” a UL/LI nav item as “active” based on click?

    Jquery/CSS: How to apply addClass with a delay of 1 sec on mouseenter event.

    How to load jQuery before CSS code?

    How do I organize imports in Compass/Blueprint?

    How to write specific CSS for mozilla, chrome and IE

    How to create a sliding navigation with either jquery or css? [closed]

    Given an url, how could a script find what resources are loaded?

    How do you overlay two divs and make them the same height?

    Bootstrap: how to clear images in a gallery?