Dimensions in jQuery
width()
The width() method is used to set or return the width of the selected elements.
Syntax:-
Its syntax is:- $(selector).width(value) OR $(selector).width(function(index,currentheight))
Further Explanation:-
Parameter | Description |
---|---|
value | Required for setting width. |
function(index,currentwidth) | Optional. Specifies a function that returns the new width of selected elements
|
height()
The height() method is used to set or return the height of the selected elements.
Syntax:-
Its syntax is:- $(selector).height(value) OR $(selector).height(function(index, currentheight))
Further Explanation:-
Parameter | Description |
---|---|
value | Required for setting height. |
function(index,currentheight) | Optional. Specifies a function that returns the new height of selected elements
|