CSS
yourSelector { background-image: linear-gradient(red, white, blue); }
JavaScript
yourVariable.style.backgroundImage = `linear-gradient(red, white, blue)`