I am looking to create a function that controls opacity when a particular element is clicked. I tried the following code, but it did not have the desired effect.
var changeOpacity = function(id) {
document.getElementById(id).style.opacity = "1";
};
<head>
<link rel="stylesheet" href="style.css" />
<script src="https://kit.fontawesome.com/71fb624cb4.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet" />
<script src="js.js"></script>
</head>
<body>
<div class="container">
<a class="home h" id="h" onclick="changeOpacity(" h ")"><i class="fas fa-home"></i>Home</a>
<a class="home acc"><i class="far fa-user-circle"></i></i>Account</a>
<a class="home fli"><i class="fas fa-fighter-jet"></i>Flights</a>
</div>
</body>
</html>