I have 2 buttons, and each button can change the body font size. I want to make the buttons that toggle. This is what I tried so far here [ https://jsfiddle.net/a6oscu8n/ ]
<style>
html { font-size:13px; }
html.big { font-size:18px; }
html.default { font-size:13px; }
</style>
<a href="#" data-size="big" class="font_resize">bigger</a><br>
<a href="#" data-size="small" class="font_resize">default</a><br>
texttexttexttext<br>
$(function() {
$('.font_resize').on('click', function() {
$('html')
.attr('class', '')
.addClass($(this).data('size'));
});
});