$( '.a1' ).click(function(){ $(this).parent().css( { height:600 } ); }); $( '.a2' ).click(function(){ $(this).parent().css( { height:300 } ); });