I am building an ecommerce site and have products. Each product may have different variables such as color. I want the shopper to be able to select a color from the side of the product, (says its a shirt) and then see the shirt in that color. This is a very common thing seen on ecommerce sites and I know that if I Was using an ecommerce solution such as shopify it would have that option, but I want to know how to do it so that I can use this in other sites that may not be ecommerce.
So, basically, how do I show an object on the left and have different colors on the right, and when a color is selected, it shows the object in that color?
I am pretty sure this can be done with HTML and CSS and maybe javascript, but I am not sure.
Any help in this matter would be greatly appreciated.