Find on this demo page all the jQuery code examples from our article. Try them all, the script doesn't record or submit any data.

DigitalOceanSSD Cloud Server from $5/month by DigitalOcean, simple cloud hosting, built for developers. Receive $10 in credits »
ServerPilotServerPilot is the best way to run WordPress and PHP sites on your DigitalOcean servers. First month free »

Simple photo gallery with thumbnails

Click each thumbnail to switch the bigger image.

big view
thumb 1 thumb 2 thumb 3

Populate a SELECT menu

Choose a color and a second SELECT menu with the available sizes.

Show/hide HTML elements based on a selection

Switch the payment options and get for the creditcard option a list of available cards.

Disable/enable the form submit button

Check/uncheck the check box element to enable or disable the submit button.

Count clicks for Google Analytics

For both links, clicks are counted within the Google Analytics web statistics software. Normally you need to add extra code to each link, but for this example, only single function is used.

The style used on this demo page is not part of the example files download. You need to use Bootstrap if you like to format the code examples like on this page.