title: jquery clone - change button value
body: <p>I'm trying to change button value after cloning with no success.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;ul id="list"&gt;    
  &lt;/ul&gt;
  
      &lt;div id="wrapper"&gt;
        &lt;table id="table1" width="600" border="0" cellspacing="0" cellpadding="0"&gt;
          &lt;tr&gt;
            &lt;td width="171"&gt;&lt;input type="button" name="btn" id="num" value="1"  padding='0'/&gt;&lt;/td&gt;
  
            &lt;td width="423"&gt;&lt;label&gt;Από:
              &lt;input type="text" name="startpoli" id="startpoli" /&gt;
            &lt;/label&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
        &lt;table id="table2" width="600" border="0" cellspacing="0" cellpadding="0"&gt;
          &lt;tr&gt;
            &lt;td width="172"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;td width="422"&gt;&lt;label&gt;Προς:
              &lt;input type="none" name="finalpoli" id="finalpoli" /&gt;
            &lt;/label&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>var er = document.getElementById('wrapper'); 
  for(var n=0;n&lt;3;n++){
    var li = document.createElement("li");
     var clone = $(er).clone();
     $(clone).find('#num').attr('id','num'+n);
     var id_num = 'num'+n;  
    $('#id_num').val(n);
    $('li').append(clone);
    document.getElementById('list').appendChild(li); 
  </code></pre>
  
  <p>Changing <code>#id_num</code> value doesn't succeed neither using <code>attr('value',n)</code>  nor 
  <code>prop('value',n)</code>. Where am I wrong;</p>