Skip to content

Instantly share code, notes, and snippets.

@Grassboy
Created July 1, 2015 15:30
Show Gist options
  • Save Grassboy/471fe148f2a3dbf056ef to your computer and use it in GitHub Desktop.
Save Grassboy/471fe148f2a3dbf056ef to your computer and use it in GitHub Desktop.
var div = $('<div class="item" data-foo="bar">');
alert(div.data('foo'));
div.attr('data-foo', 'barbarbar');
alert(div.data('foo'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment