I need to change the width of a div using jQuery.
When I use the following, it works:
$('#footer').css('width', '100%'); $('#footer').css('width', '-=239');
When I use this, it works:
$('#footer').css('width', '100%'); $('#footer').css('width', '-=239px');
But when I use this, it does nothing:
$('#footer').css('width', '100%'); $('#footer').css('width', '-=21em');
Is there a way to get jQuery to work with em ? or calculate em to px and set a variable, for example, and subtract this value?
edit: thanks to everyone for correcting my spelling and code!
source share