Answer the question
In order to leave comments, you need to log in
How to pass background-gradient to jQuery?
Hello!
For example, to transfer one color - https://jsfiddle.net/vhe9ek72/
But for a gradient, this option does not work - https://jsfiddle.net/0hk9xyLk/
Tell me how to transfer background-gradient?
Answer the question
In order to leave comments, you need to log in
(function() {
var buttonsColor = $('button[data-color]');
buttonsColor.each(function() {
var customColor = $(this).attr("data-color");
$(this).attr('style',"background: "+customColor+";");
});
})();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question