I started studying jQuery yesterday by doing tutorials
well I’m on tutorial 28/200 now. This seems like an error so I made a jsFiddles for this.
Sample code: jsFiddles
problem: why do input buttons not share similar functionality to anchors i.e shrink or increase paragraph size? I mean I probably would never do this but why does it occur? Is it even an error?
The buttons are actually working (temporarily). The problem is that you’re using “submit” as the input type which is causing the form to be submitted and the page re-rendered.
To fix your example, either change the input types to “button” or add an event.preventDefault(); to each of the click handlers (you’ll also need to add “event” as an parameter for each handler).