Get line-height of element without ‘px’

Parse it as an integer with parseInt

parseInt($('#example').css('line-height'), 10);

Outputs:

18

As an integer. The other solutions maintain the String type.

EDIT

For values that may contain decimal points, you can use parseFloat()

parseFloat($('#example').css('line-height'));

Outputs:

18.4

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)