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.

MoosendMoosend, the All-in-One marketing platform your business deserves. Start free today »
CloudwaysCloudways The Ultimate Managed Cloud Hosting Platform. Start Your Free Trial » No Credit Card Required.

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.