Try
$('.mainDiv div').click(function(){
var className = $(this).attr('class');
});
More Related Contents:
- Find a string of text in an element and wrap some span tags round it
- jQuery click events not working in iOS [duplicate]
- Selecting HTML comments with jQuery
- How do I use jQuery for click event in iPhone web application
- How to get screen width without (minus) scrollbar?
- Upload fails when user drags and drops attachment from email client
- Get clicked element using jQuery on event?
- Cannot modify content of iframe, what is wrong?
- How do I change the background image using jQuery animation?
- jQuery: Check if image exists
- jQuery override default validation error message display (Css) Popup/Tooltip like
- How do I select elements on multiple attribute values
- How to attach callback to jquery effect on dialog show?
- jQuery attribute selector for multiple values
- How can I execute multiple, simultaneous jquery effects?
- How can I disable a button on a jQuery UI dialog?
- Detect page change on DataTable
- Fancybox: iframe doesn’t work
- Using jquery to make a POST, how to properly supply ‘data’ parameter?
- Twitter Bootstrap add active class to li
- Animate an element’s width from 0 to 100%, with it and it’s wrapper being only as wide as they need to be, without a pre-set width, in CSS3 or jQuery
- Detect change to selected date with bootstrap-datepicker
- Use jQuery to convert JSON array to HTML bulleted list
- How to get form html() via jQuery including updated value attributes?
- How to handle the modal closing event in Twitter Bootstrap?
- How to sort by Date with DataTables jquery plugin?
- jQuery detect click on disabled submit button
- How can I disable Ctrl+A (select all) using jquery in a browser?
- What jQuery version to mention in code
- Listen to changes within a DIV and act accordingly