jQuery just make's everything easier. Here jQuery binds the tag with the id "content" to a click event, and then changes the tags "src" attribute to the page we want to show using the counter variable and the modulus of the total number of pages. We'll output the new "src" attribute value to the console for troubleshooting. On Chrome you can see the console by rightclicking "Inspect element" or ctrl-shft-c.
Puro JS and bad HTML
This kind of code is frowned upon, but you can actually set the callback function of an event in the HTML.
Puro JS another way
Now we do what we did with jQuery, only with pure JS.