how to get a class from a jquery element object code example Example: how to get class name in jquery var className = $('#sidebar').attr('class');