Before asking, i want to let you know that the following code has been taken from this video, so all credits to him.
JS
$(".product-colors span").click(function(){
$(".product-colors span").removeClass("active");
$(this).addClass("active");
$("body").css("background",$(this).attr("data-color"));
$(".product-price").css("color",$(this).attr("data-color"));
$(".product-button").css("color",$(this).attr("data-color"));
$(".product-pic").css("background-image",$(this).attr("data-pic"));
});
HTML
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-8"></script>
</head>
<body>
<div class="product-card">
<h1>Title</h1>
<p>Thing<p>
<div class="product-pic"></div>
<div class="product-colors">
<span class="blue active" data-color="#7ed6df" data-pic="url(1.png)"></span>
<span class="green" data-color="#badc58" data-pic="url(2.png)"></span>
<span class="yellow" data-color="#f9ca24" data-pic="url(3.png)"></span>
<span class="rose" data-color="#ff7979" data-pic="url(4.png)"></span>
</div>
<div class="product-info">
<div class="product-price">1.000.000$ </div>
<a href="#" class="product-button">BUY</a>
</div>
</div>
</body>
</html>
$(".product-colors span").click(function() {
$(".product-colors span").removeClass("active");
$(this).addClass("active");
$("body").css("background", $(this).attr("data-color"));
$(".product-price").css("color", $(this).attr("data-color"));
$(".product-button").css("color", $(this).attr("data-color"));
$(".product-pic").css("background-image", $(this).attr("data-pic"));
});
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div class="product-card">
<h1>Title</h1>
<p>Thing
<p>
<div class="product-pic"></div>
<div class="product-colors">
<span class="blue active" data-color="#7ed6df" data-pic="url(1.png)"></span>
<span class="green" data-color="#badc58" data-pic="url(2.png)"></span>
<span class="yellow" data-color="#f9ca24" data-pic="url(3.png)"></span>
<span class="rose" data-color="#ff7979" data-pic="url(4.png)"></span>
</div>
<div class="product-info">
<div class="product-price">1.000.000$ </div>
<a href="#" class="product-button">BUY</a>
</div>
</div>
</body>
</html>
basically i want to edit the hover of "product-button" on click and change his background but i don't know how to do it, cause i'm very new to html/css and this stuff. I tried too "googling" too and i found out that jquery is an old and outdated language, so i can use javascript instead of this? Thank you for your help