Currently learning HTML and attempting to design a dashboard. I want to display the status (ON, OFF, OPEN, or CLOSED) of a room or door using an icon.
I have images for open/close doors and lightbulbs. Need assistance in adding an element to all the existing "li" elements.
Have tried watching tutorials, but they were too complex for me to understand.
<!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>Dashboard</title>
<!-- Add font from Google fonts -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet>
<!-- Link CSS style sheet to html document -->
<link rel="stylesheet" href="style.css>
<!-- Link JavaScript file to html document -->
<script src="mqttws31.js> </script>
<script src="dashboard.js> </script>
</head>
<body>
<div class="header>
<h1>Home Automation Dashboard</h1>
</div>
<hr>
<div id="messages></div>
<div id="status></div>
<hr>
<ul class="dashboard>
<li class="dashboard_item kitchen>
<h4>Kitchen</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
<li class="dashboard_item frontdoor>
<h4>Front Door</h4>
<p>CLOSED</p>
</li>
<li class="dashboard_item balconydoor>
<h4>Balcony Door</h4>
<p>CLOSED</p>
</li>
<li class="dashboard_item livingroom>
<h4>Livingroom</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
<li class="dashboard_item bedroom>
<h4>Bedroom</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
<li class="dashboard_item bathroom>
<h4>Bathroom</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
<li class="dashboard_item studyroom>
<h4>Studyroom</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
<li class="dashboard_item hall>
<h4>Hall</h4>
<p>OFF</p>
<button>Toggle</button>
</li>
</ul>
</body>
</html>