JQuery AppendTo Title attribute
<p>I'm following this tutorial <a href="http://qoate.com/231/create-drag-and-drop-inventory-using-jquery/" rel="nofollow">Drag Drop Inventory in Jquery</a></p>

<p>and i'm having a problem. In the demo that accompanies the tutorial, the author uses this code :</p>

<pre><code>item.attr('src',drag_item.attr('src')).attr('class',drag_item.attr('class')).appendTo(spot).draggable({ revert: 'invalid' });
</code></pre>

<p>While this works great in recreating the img element, it does not copy the title attribute( i want to copy that because it's important for my tooltips).</p>

<p>I've changed this code like :</p>

<pre><code>item.attr('title',drag_item.attr('title')).attr('src',drag_item.attr('src')).attr('class',drag_item.attr('class')).appendTo(spot).draggable({ revert: 'invalid' });
</code></pre>

<p>which should work i think, but it does not. When i change drag_item.attr('title') to something static like "hello", it works, but the attr func does not return the title.</p>

<p>My html is like :</p>

<pre><code>&lt;div id="inventory" style="width:300px; height:150px; margin:10px; padding:15px; border:1px solid black; display:block; clear:both;"&gt;
 &lt;% @inv_items.each do |i| %&gt;
   &lt;% w = Weapon.find_by_id(i.item_id) %&gt;

      &lt;img class='weapons' src= "/images/weapons/&lt;%=h w.imageName %&gt;" title="&lt;%= setWeaponTitleForTooltip(w, i) %&gt;" /&gt;
 &lt;% end %&gt;
&lt;/div&gt;
</code></pre>

<p>The html is actually an erb template. Do you have any idea why this happens ?</p>
