document.getElementById('content1').style.color = p_color;
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.
Remember Perl? TMTOWTDI
Thank you for the response. I almost got trying to reassign the class. However, the following code worked too.
document.getElementById('p_body').style.backgroundImage = "-webkit-gradient(linear, 40% 0%, 0% 62%, from(#150C66), to(#0D6622), color-stop(.3,#053331))";
I have variables to assign the color of my choice.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)