All the characters in breaking down a string confuse me.
I'm trying to understand how to find whatever number is in a string, and increment it up/down by one (unless it's a known last or first number?)
$('#arrow_prev').click(function(){
var whichgallery = $('#div_id').attr('class');
// this could be .class_1 through .class_12
var nextgallery = ".".(return whichgallery.replace(/\d+$/, function(s) {
return +s+1;);
//something like this?
$(nextgallery).click();
)};