I wrote a function that was supposed to change colour of a div according to the value of paragraph that is inside it but it doesn’t work for some reason any suggestions?
<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">
<link rel="stylesheet" href="styles.css">
<title>Document</title>
</head>
<body>
<div id="poo"> <p id="po">0</p></div>
<div id="piss"><p id="pis">15</p></div>
<div id="psll"><p id="psl">30</p></div>
<button onclick="checkMissing()">12121</button>
<script>
function checkMissing () {
let a = document.getElementById('po').value;
let b = document.getElementById('pis').value;
let c = document.getElementById('psl').value;
let d = document.getElementById('poo');
let e = document.getElementById('piss');
let f = document.getElementById('psll');
if (a == 0) {
return d.bgColor = "red";
} else if (a <= 5 ) {
return d.bgColor = "yellow";
} else {
return d.bgColor = "Honeydew";
}
}
function updateee() {
}
</script>
</body>
</html>