<script language="javascript">
var widthx = document.getElementById('testx');
var newwidth = document.getElementById('mycontent').style.width = widthx.width + 45 //not working
</script>
<style type="text/css">
#testx
{
width: 950px;
}
#mycontent
{
width: 800px; //this width needs to change from javascript to 950 + 45 px
}
....
I want to change mycontent’s width to be testx width + 45 pixels (px). Anybody knows how to do this in javascript ?
With jQuery: