Problem 33. Write a JavaScript code to change background of all <li> tags to cyan.

<body>
                    <nav id="navbar">
                        <li>home</li>
                        <li>about us</li>
                        <li>contact us</li>
                    </nav>
                </body>
<style>
    html, body {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        background-color: #efefef;
    }
                                  
    #navbar {
        background-color: #fefefe;
        display: flex;
        height: 2rem;
    }
                                  
    li {
        margin: 0 20px;
        font-size: 1.5em;
        list-style: none;
    }
</style>
<script>
    Array.from(document.getElementsByTagName("li")).forEach((element) => {
        element.style.background = "cyan";
    });
</script>

Output:

output