I am making a game, and I need to know how to change the textures and colors of an object in JavaScript.

I have made a menu where you can pick which texture and color to apply to your character, but I don’t know what script or the commands to use to do it. I know how to put the events all in play, just not how to change the texture and color in JavaScript.