title: jQuery append div inside div with id and manipulate
body: <p>after 2 hours of searching I decided to ask my question.</p>
  <p>I have a div:</p>
  <pre><code>&lt;div id=&quot;box&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>I want to add a div inside the above div using jQuery.</p>
  <p>I tried (following code is inside a function):</p>
  <pre><code>var e = $('&lt;div style=&quot;display:block; float:left;width:'+width+'px; height:'+height+'px; margin-top:'+positionY+'px;margin-left:'+positionX+'px;border:1px dashed #CCCCCC;&quot;&gt;&lt;/div&gt;');
  $('div', e).attr('id', 'myid');
  $(&quot;#box&quot;).append(e);
  </code></pre>
  <p>But accessing <code>$(&quot;#myid&quot;)</code> is not working.</p>
  <p>Any idea on how to add a div inside a div and be able to manipulate them?</p>