Testing jQuery.data() with undefined value
by rwaldron
HTML
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<div id="test">hi</div>
JavaScript
var testDiv = $('#test');
testDiv.data("someData", "value");
testDiv.data("someData", undefined);
console.log(testDiv.data("someData"));
testDiv.data("someData", null);
console.log(testDiv.data("someData"));