Get page number in a ListView when clicked

I’d like to get the page number in a ListView (with jQuery) when the user clicks on it. How can I do this?

Never mind, I got the answer!


        $('.pagination li a').click(function(){

             alert($(this).attr('data-page') + 1));

        });