How to set a random colour using jQuery and JavaScript Written by Adrian Gordon Tech Tips Learn how to generate a random color using jQuery and JavaScript for your website design. This article provides a code example for setting a random background color for text inputs.