I want to ask if it's possible to use the setProperty() method into changing the 'repeating-linear-gradient' in css? I seem to be having problems changing the colors of the stripes in CSS. If anyone can help me use the setProperty() method or any other method that will allow me to change the color of stripes then that will be great.
Here is my code:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<script src="app2.js"></script>
</body>
</html>
CSS:
body {
height: 100vh;
background-image: repeating-linear-gradient(
45deg,
#039BE5 0px,
#039BE5 20px,
#90CAF9 20px,
#90CAF9 40px
);
}
JS:
let body = document.querySelector('body')
let style = body.style.setProperty('background', `repeating-linear-gradient(
45deg,
#000 0px,
#111 20px,
#222 20px,
#333 40px
);`)
If anyone can help me, that will be much appreciated