I check the jQuery plugin site, which teach me how to write a basic plugin:
(function( $ ){
$.fn.maxHeight = function() {
var max = 0;
this.each(function() {
max = Math.max( max, $(this).height() );
});
return max;
};
})( jQuery );
Then, the div can have the maxHeight method, like this:
var tallest = $('div').maxHeight(); // Returns the height of the tallest div
But I would like to only textarea have maxHeight function, but not the div. How can I do so?