$(document).ready(function(){ $('#clicker').click(function(){ var count = parseInt($(this).attr('data-count')) + 1; $('#clickedNum').text('The button was clicked ' + count + ' times'); $('#clicker').attr('data-count', count); }); })
Translate »