/ Published in: JavaScript

I didn't realise until now you could do this in jQuery, very useful. Store a value for later use, then remove it.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Store a color $(this).data('color', $(this).css('color')); //Retrieve the color later $(this).css('color', $(this).data('color')); //Remove the data $(this).removeData('color');
Comments
