jQuery - How do I convert a pixel value (20px) to a number value (20)

Posted by John Himmelman on Stack Overflow See other posts from Stack Overflow or by John Himmelman
Published on 2010-06-11T15:30:27Z Indexed on 2010/06/11 15:32 UTC
Read the original article Hit count: 183

Filed under:
|

I know jQuery has a helper method for parsing unit strings into numbers. What is the jQuery method to do this?

var a = "20px";
var b = 20;
var c = $.parseMethod(a) + b;

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery