title: Setting dynamically distinct id attribute using javascript for input element
body: <p>I am facing a problem in setting distinct ids for dynamically added input boxes in a table. 
  The problem is:</p>
  
  <p>I am inserting new rows when the user clicks on "Add new Row". Now I have to set distinct id for the input box. I have taken a static variable and increasing its value every time user clicks on add new row button. Then I am appending its value to id value lets say temp (i.e. ids will be <code>temp1</code>, <code>temp2</code> and so on). I have taken a variable xyz as
  <code>var xyz = "temp" + i</code> (where i is the counter)
  and now I have to assign <code>xyz</code> to the id using <code>setattribute</code>.
  But as values in <code>setattribute</code> can only be literals, how can I use a variable in place of the value?</p>
  
  <p>If you have any other methods, please let me know.</p>