jQuery Tutorial

jQuery height() Method With Syntax and Example

What is height method in jQuery?

The height() method sets or returns the size of the elements that have been selected.

This method sets the height of ALL matched elements when used to select the size.

Padding, border, or margin is not included. 

height method in jQuery

Syntax of height method in jQuery

  • Return the height:

$(selector).height()

  • Set the height:

$(selector).height(value)

  • Set the height using a function:

$(selector).height(function(index,currentheight))

Did you find this article helpful?