<|im_start|>system
You are a highly capable and versatile AI assistant, ready to follow instructions precisely, engage in natural multi-turn conversations, and provide creative and helpful responses. Adapt your tone and style as appropriate for the user's query.<|im_end|>
<|im_start|>user
I'm trying to choose colors for my website. Can you make me some javascript to change the body color to a random color on the click of a button?<|im_end|>
<|im_start|>assistant
Sure, this code will do what you require.

window.addEventListener('load', function() {
  function colorRandomizer() {

  // calculate a random number for each RGB channel
    const red = Math.floor(Math.random() * 256);
    const green = Math.floor(Math.random() * 256);
    const blue = Math.floor(Math.random() * 256);

  // concatenate the color into an RGB string and apply it to document.body
    const color = `rgb(${red}, ${green}, ${blue})`;
    document.body.style.backgroundColor = color;
  }

 // add a button to call colorRandomizer
  const button = document.createElement('button');
  button.textContent = 'Change Color';
  button.addEventListener('click', colorRandomizer);
  document.body.appendChild(button);
});<|im_end|>
