Hi,
I have DIV section with a CSS class that defines a gradient. However, when the user clicks a button, I want to dynamically change the two colors of gradient via Javascript. What is the DOM structure to change the colors in this field similar to this command:
document.getElementById('content1').style.color = p_color;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.32, rgb(20,1,9)),
color-stop(0.66, rgb(36,41,171))
Make it easy on yourself, when the target has been clicked, add a classname to the element and just put the gradient you want in a separate class name in your css.
Alternatively, if you only want to apply it onclick, don't forget the :active pseudo-class.
Bookmarks