title: adding css styles to dynamically added <form> elements in java script
body: <p>I used the following code (Javascript) to dynamically load  elements into "Mobile Webpage". It works fine but i can't set CSS styles(like height,width...) to those newly added  elements.</p>
  
  <p>here by this code buttons are loaded perfectly .
  in this i am unable to vary the size of dynamically loaded button using css elements.</p>
  
  <pre><code>&lt;head&gt;
  &lt;script type="text/javascript"&gt;
  var arrayToModify = [];
  window.onload = function () {
  var i, MyArray, ButtonContainer, NewButton;
  MyArray = ["Option 1","Option 2","Option 3","Option 4","Option 5"];
  ButtonContainer = document.getElementById("Button_holder");
  for (i = 0; i &lt; MyArray.length; i++) {
  NewButton = document.createElement('input');
  NewButton.type = 'button';
  NewButton.value = MyArray[i];
  NewButton.id = MyArray[i];;
  NewButton.onclick = function () {
  alert('You Clicked '+this.id);
  arrayToModify[arrayToModify.length] = this.id;
  };
  ButtonContainer.appendChild(NewButton);
  }
  };
  &lt;/script&gt;
  &lt;style&gt;
  NewButton
  {
  width:100%;
  height:120px;
  background-color:red;
  }
  ButtonContainer
  {
  width:100%;
  height:120px;
  background-color:yellow;
  }
  .divclass
  {
  height:400px;
  background-color:lightblue;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="Button_holder" class="divclass"&gt;
  &lt;/div&gt;
  &lt;input type='button' onclick='alert(arrayToModify);' class="ntl" value='Vote' /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>