title: Pass variable in document.getElementByid in javascript
body: <p>I have a variable account_number in which account number is stored. now i want to get the value of the element having id as account_number. How to do it in javascript ? </p>
  
  <p>I tried doing document.getElementById(account_number).value, but it is null.</p>
  
  <p>html looks like this :</p>
  
  <pre><code>&lt;input class='transparent' disabled type='text' name='113114234567_name' id='113114234567_name' value = 'Neeloy' style='border:0px;height:25px;font-size:16px;line-height:25px;' /&gt;
  </code></pre>
  
  <p>and the js is :</p>
  
  <pre><code>function getElement()
  {   
   var acc_list = document.forms.editBeneficiary.elements.bene_account_number_edit;
  
      for(var i=0;i&lt;acc_list.length;i++)
          {
              if(acc_list[i].checked == true)
                  {
  
                      var account_number = acc_list[i].value.toString();
                      var ben_name = account_number + "_name";
  
                      alert(document.getElementById("'" + ben_name.toString() + "'").value);
                  }
           }
  </code></pre>
  
  <p>}</p>
  
  <p>here bene_account_number_edit are the radio buttons.</p>
  
  <p>Thanks </p>