<button id="button" data-options='{"foo": "bar"}'>BUTTON</button>
<script>
button.onclick = function() {
var options = JSON.parse(button.dataset.options);
options[1334] = 'test';
options.now = Date.now();
options.randomNumber = Math.random();
button.dataset.options = JSON.stringify(options);
console.log(button);
};
</script>