var $button=$('.pagination li.active span').parent().next('li').children('a'); $button.on('click', function() { window.location = this.href; }) $button.trigger('click');