title: changing HTML form with javascript
body: <p>I can't figure out how the size of the form can be determined with javascript, and how to change it.  I've tried element.style.width but that isn't doing it either for reading or writing.  I don't know what I'm looking for in the debugger either.
  I need to change the width of the form depending on the length of the text in the newNameNode text node.  </p>
  
  <p>Thanks very much for any help.</p>
  
  <p>Gerard</p>
  
  <p>Here's my code -
      
      
      
       </p>
  
  <pre><code>&lt;form name="Q1"  autocomplete="off"&gt;
  &lt;fieldset&gt;
  &lt;legend&gt;1&lt;/legend&gt;
  Ludwig Van Beethoven&lt;br /&gt;
  &lt;input type="radio" name="Q1" value="1756-1819"&gt;&lt;span&gt;1756-1819&lt;/span&gt;&lt;br&gt;
  &lt;input type="radio" name="Q1" value="1770-1827,Beethoven,correct"&gt;&lt;span&gt; 1770-1827&lt;/span&gt;&lt;br /&gt;
  &lt;input type="radio" name="Q1" value="1815-1858"&gt;&lt;span&gt; 1815-1858&lt;/span&gt;&lt;br /&gt;
  &lt;input type="radio" name="Q1" value="1832-1870"&gt;&lt;span&gt; 1832-1870&lt;/span&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt; 
  
  &lt;script &gt;
  function buildForm() {
  
  var newForm = document.createElement('form');
      newForm.name = "Q1";
      newForm.autocomplete = "off";
  
  var newFieldset = document.createElement('fieldset');
  
  var newNameNode = document.createTextNode('new text');
  var br = document.createElement('br');
  var newRadio = document.createElement('input');
      newRadio.type = 'radio';
      newRadio.name = 'Q1';
      newRadio.value = "new value";
  var dates ="1770-1827";         
  var newDateSpan = document.createElement('span');       
      newDateSpan.innerHTML = " " + dates + "&lt;br /&gt;";
      console.log("newSpan.innerHTML: " + newDateSpan.innerHTML); //!!
  
  var newLegend = document.createElement('legend');
      newLegend.innerHTML = newRadio.name;
  
  newFieldset.appendChild(newLegend); 
  newFieldset.appendChild(newNameNode);
  newFieldset.appendChild(br);
  newFieldset.appendChild(newRadio);
  newFieldset.appendChild(newDateSpan);
  newForm.appendChild(newFieldset);
  document.body.appendChild(newForm);     
  }
  buildForm();
  &lt;/script&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>