I googled and googled and I concluded that it\'s very hard to get answer on my own.
I am trying to use jquery or JavaScript to get a property of clicked element. I c
This example will work on every element in the page. I'd recommend using console.log(event)
and poking around at what it dumps into your console with Firebug/Developer tools.
$(window).click(function(e) {
console.log(e); // then e.srcElement.className has the class
});
window.onclick = function(e) {
console.log(e); // then e.srcElement.className has the class
}
http://jsfiddle.net/M2Wvp/
Edit
For clarification, you don't have to log console for the e.srcElement.className
to have the class, hopefully that doesn't confuse anyone. It's meant to show that within the function, that will have the class name.