jquery assign value to key via .data() not working
<p>I have a pretty straightforward (one would think) task.  </p>

<p>Pass a value to a popup window and based on a click (proceed or cancel) perform an action using the value passed.</p>

<pre><code>    // on click we pass the value to the function testing - so far so good
$('#numbers').delegate('.icondelete', 'click', function(){
    testing( $(this).attr('data-options') ); 
});
</code></pre>

<p>I pass the value found to a function, then try to assign it to a key</p>

<pre><code>function testing(id){
   //we can see that it passed successfully
    alert("here it is: " + id); 

     //push the data into key data-id
    $('#dodelete').data('data-id',id);

//but this alert doesn't return the value
alert("it should be here shouldn't it? " + $('#dodelete').attr('data-id'));
    }
</code></pre>

<p>html</p>

<pre><code>&lt;div id='numbers' &gt;
&lt;div class='icondelete'  data-options='123' &gt;Set data-options as 123 - click here to test&lt;/div&gt;
&lt;/div&gt;

&lt;br&gt;&lt;br&gt;
&lt;div id='dodelete' data-id=''&gt;landing div&lt;/div&gt;
</code></pre>

<p>If you check out the fiddle <a href="http://jsfiddle.net/Microbe/cRLfC/4/" rel="nofollow">http://jsfiddle.net/Microbe/cRLfC/4/</a> , you can see that the value is passed into the function no probs, but then when I try to assign it to the key it doesn't.</p>

<p>Where am I going wrong?</p>
