If you have not indicated the initial status of the element, it could be any of the following possibilities:
- No specified width
- A specified width in pixels (the unit you aim to adjust)
- A width specified in a different unit
To start off, you need to standardize this. One way to do it is by using getComputedStyle
. However, since jQuery is being used (or at least mentioned in the question), you can let jQuery take care of it.
var element = jQuery('#Left');
var initial_width = element.width();
This will provide you with the width in pixels as a Number.
You can then increase this value and set the width to the new measurement.
var desired_width = initial_width + 240;
element.width(desired_width);
Alternatively, in a single line:
jQuery('#Left').width( jQuery('#Left').width() + 240 );
View a live demonstration
If you prefer to work 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 example.