Change Theme using jQuery Split Button

In this post, we are going to see how to change theme color using jQuery. We have an example with a split button having two parts. One is for default theme and the other is to browse more themes.

In this example, we have three themes Mercury, Sky, Gold and separate CSS files for these themes. We are switching CSS files based on the selected theme. Then it will reflect on the split button and its dropdown UI.

Change Split Button Theme

This jQuery script is used to handle the split button click event. On clicking “Default Theme” the default-theme.css will be applied. And the “More” button, it shows a list of themes. On selecting themes it will change the button styles by loading the corresponding stylesheet.