var baz 150 selector data fooBar baz attr data-foo-bar baz

1
2
var baz = 150;
$(selector).data('fooBar', baz).attr('data-foo-bar', baz);