Since you haven't stated what the initial status of the element is, it could be any one of the following:
- No width specified
- A width specified in pixels (the unit you want to modify it with)
- A width specified in some other unit
So the first thing you must do is normalise this. You can do this using getComputedStyle
, but since you are using jQuery (or have at least tagged it on the question), you can also just let it handle it for you.
var element = jQuery('#Left');
var initial_width = element.width();
This will give you the width in pixels expressed as a Number.
You can then add to this and set the width to the new value.
var desired_width = initial_width + 240;
element.width(desired_width);
Or in one line:
jQuery('#Left').width( jQuery('#Left').width() + 240 );
See a live demo
Or without jQuery:
var element = document.getElementById('Left');
var style = getComputedStyle(element, null);
var initial_width = style.width;
var initial_pixels = parseFloat(initial_width);
element.style.width = initial_pixels + 240 + "px";
See a live demo.