title: change width of a div dynamically
body: <p>I am trying to change my "inner" div's width dynamically on the click that the images are changed (which works) with a similar script. I cannot get the script to work, any help fixing it, or changing it would be appreciated. I am a noob in javascript so please be nice ;-)</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
       function setBase(baseval) {
      var images = document.getElementById("mylist").getElementsByTagName("img");
      for (var i = 0; i &lt; images.length; i++) {
      images[i].src = baseval + ((i&lt;9)?0+i:i) + ".jpg"; 
       }
      }
  &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
       function setStyle(baseval) {
      var style = document.getElementById("inner").getElementsByTagName("div");
      for (var i = 0; i &lt; images.length; i++) {
      style[i].style = baseval + "px"; 
       }
      }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;div id="mylist" style="  height: 481px; width: 700px; overflow-x: auto;  "&gt;
  &lt;div id="inner" style="width: 7300px "&gt;
  
          &lt;img src="carousel_img/1/1.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/2.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/3.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/4.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/5.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/6.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/7.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/8.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/9.jpg" height="450" /&gt;
      &lt;img src="carousel_img/1/10.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/0.jpg" height="450" /&gt;
          &lt;img src="carousel_img/1/11.jpg" height="450" /&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;p&gt;
  &lt;a href="#" onclick="setBase('carousel_img/1/'); setStyle('7300'); return false;"&gt;Set A&lt;/a&gt;
  &lt;a href="#" onclick="setBase('carousel_img/3/'); setStyle('6300'); return false;"&gt;Set B&lt;/a&gt;
  &lt;/p&gt;
  </code></pre>