samedi 30 juillet 2016

How to increment a numeric string by +1 with Javascript/jQuery

I have the following variable: pageID = 7 I'd like to increment this number on a link: $('#arrowRight').attr('href', 'page.html?='+pageID); So this outputs 7, I'd like to append the link to say 8. But if I add +1: $('#arrowRight').attr('href', 'page.html?='+pageID+1); I get the following output: 1.html?=71 instead of 8. How can I increment this number to be pageID+1?

Aucun commentaire:

Enregistrer un commentaire