I need to do a numeric calculation based on CSS properties. However, when I use this to get info:
$(this).css(\'marginBottom\')
it returns
This will clean up all non-digits, non-dots, and not-minus-sign from the string:
$(this).css('marginBottom').replace(/[^-\d\.]/g, '');
UPDATED for negative values