Помогите написать поиск по сайту на js

Я только начал изучать js и очень мало чего понимаю. Хочу попросить помощи, как написать код для поиска

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title> WayStore </title>
        <link rel="stylesheet" href="css/style.css">
        <link href="https://fonts.googleapis.com/css2?family=Titillium+Web&display=swap" rel="stylesheet">
        <meta name="viewport" content="width=device-width">

    </head>

    <body>

        <header>
            <div class="logo">
                <a href="index.html"><img class="graficlogo" src="img/logo.png"></a>
            </div>
        </header>

        <div id="sidebar">
            <h3> Каталог товаров </h3>
                <ul>
                    <li><a href="#"> Категория 1 </a></li>
                    <li><a href="#"> Категория 2 </a></li>
                    <li><a href="#"> Категория 3 </a></li>
                    <li><a href="#"> Категория 4 </a></li>
                    <li><a href="#"> Категория 5 </a></li>
                    <li><a href="#"> Категория 6 </a></li>
                    <li><a href="#"> Категория 7 </a></li>
                </ul>
        </div>
  <div id="sidebar__icon"><a href="#"> &#9776; </a></div>

        <input type="text" onekeyup="myFunction()" id="myInput" name="search" class="search" placeholder="Поиск по сайту">

        <main>

            <div class="tovari_block"> <!-- Товар блоки -->


                <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/telefon.png">
                        <div class="tovar_list">
                            <h3> Huawei P30 Lite </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_true">
                                    <h5> Есть в наличии. </h5>
                                    </div>          
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/tovar_iphone11proMAX.png">
                        <div class="tovar_list">
                            <h3> Iphone 11 Pro Max </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_false">
                                    <h5> Нет в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/telefon.png">
                        <div class="tovar_list">
                            <h3> Huawei P30 Lite </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_true">
                                    <h5> Есть в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/tovar_iphone11proMAX.png">
                        <div class="tovar_list">
                            <h3> Iphone 11 Pro Max </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_false">
                                    <h5> Нет в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>


        </div> <!-- Товар блоки -->

        <div class="tovari_block"> <!-- Товар блоки -->


                <div class="tovari_block"> <!-- Товар блоки -->


                <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/telefon.png">
                        <div class="tovar_list">
                            <h3> Huawei P30 Lite </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_true">
                                    <h5> Есть в наличии. </h5>
                                    </div>          
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/tovar_iphone11proMAX.png">
                        <div class="tovar_list">
                            <h3> Iphone 11 Pro Max </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_false">
                                    <h5> Нет в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/telefon.png">
                        <div class="tovar_list">
                            <h3> Huawei P30 Lite </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_true">
                                    <h5> Есть в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="tovari_items">
                    <div class="tovar_img"><img src="img\tovari_leaderpage/tovar_iphone11proMAX.png">
                        <div class="tovar_list">
                            <h3> Iphone 11 Pro Max </h3>
                                <div id="price">
                                    <h5> 9999 грн. </h5>
                                    </div>
                                <div id="quantity_false">
                                    <h5> Нет в наличии. </h5>
                                    </div>              
                                <div class="button">
                            <a href="https://mail.google.com/mail/u/0/#inbox?compose=CllgCHrkVmDmsQtcjCmMSdfnSmKtdCgPkWZshzFSbSpBgWxqVJHWcxNKWJdPBVqVbrnFFKvThLV" target="_blank">
                                <button class="buy" > Купить </button></a>
                            <p> Код товара: 000000 </p>
                        </div>
                    </div>
                </div>
            </div>


        </div> <!-- Товар блоки -->

        </main>



        <footer>
            <div class="social">
                <p> Мы в социальных сетях! </p>
                    <div class="footer_social_img">
                        <a href="#"><img src="img/social_footer/footer_icon_instagram.png"></a>
                        <a href="#"><img src="img/social_footer/footer_icon_facebook.png"></a>
                        <a href="#"><img src="img/social_footer/footer_icon_twitter.png"></a>
                    </div>
            </div>
        </footer>

        <script type="text/javascript" src="js/script.js"></script>
    </body>

</html>

body {
  margin: 0px;
  padding: 0px;
  height: 100%;
  font-family: 'Titillium Web', sans-serif;
}

html {
  height: 100%;
}

a {
  text-decoration: none;
}

.graficlogo {
    padding: 5px;
    max-width: 100%;
  box-sizing: border-box;
}

header {
  width: 100%;
  display: flex;
  justify-content: center;
    background: #F6C010;
    margin: 0;
}

#sidebar {
  border-right: 5px solid #F6C010;
  float: left;
  padding: 5px;
  margin-top: 3px;
  margin-bottom: 3px;
  background: #151718;
  width: 200px;
  height: 100%;
  position: relative;
}

#sidebar h3 {
  position: relative;
  color: white;
  text-align: center;
}

#sidebar__icon {
  display: none;
  float: left;
  position: relative;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  background: #151718;
}

#sidebar__icon a {
  display: block;
  color: white;
}

.sidebar__active {
  display: block !important;
}

.search {
  outline: none;
  border-radius: 3px;
  display: flex;
  margin: auto;
  padding: 10px;
  margin-top: 20px;
  border: 2px solid #F6C010;
  width: 30%;
  height: 26px;
}

main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  padding: 5px;
  flex-wrap: wrap;
  position: relative;
}

ul {
  margin: 0px;
  padding: 0px;
}

ul li {
  list-style: none;
  margin: 0;
}

ul li a {
  background: #1C1E1F;
  color: white;
  display: block;
  border-bottom: 1px solid black;
  width: 180px;
  padding: 10px;
  text-decoration: none;
  margin: 0;
}

ul li a:hover {
  background: #F6C010;
  transition: 0.25s;
  color: white;
}

footer {
  box-sizing: border-box;
  display: block;
  bottom: 0;
    background: #F6C010;
    height: 30%;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.social p {
  color: white;
  font-size: 25px;
}

.footer_social_img {
  display: flex;
  justify-content: space-around;
}

.tovari_items {
  position: relative;
  display: flex;
  margin-top: 40px;
  margin-bottom: 40px;
  margin-left: 50px;
  margin-right: 50px;
  padding: 25px;
  box-shadow: 0 0 10px;
  cursor: pointer;
}

.tovari_block {
  margin-top: -10px;
  display: flex;
  flex-wrap: wrap;
}

.tovari_items:hover {
  box-shadow: 0 0 20px;
  transition: 0.25s;
}

.tovar_list h3 {
  display: flex;
  justify-content: center;
}

.tovar_list p {
  text-align: center;
  font-size: 14px;
  color: #6B6B6B;
}

#price h5 {
  border-bottom: 2px solid #F6C010;
  font-size: 16px;
  padding-bottom: 5px;
  display: flex;
  justify-content: center;
}

#quantity_true h5 {
  margin-top: -17px;
  display: flex;
  color: #54C418;
  justify-content: center;
  font-size: 14px;
}

#quantity_false h5 {
  margin-top: -17px;
  display: flex;
  color: #FF0800;
  justify-content: center;
  font-size: 14px;
}

.buy {
  cursor: pointer;
  outline: none;
  display: flex;
  width: 100%;
  background: #68D81E;
  padding: 5px;
  justify-content: center;
  color: white;
  border: none;
  font-weight: 800;
}

.buy:hover {
  background: #82F238;
  transition: 0.25s;
}

@media screen and (max-width: 1290px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    width: 30%;
    box-sizing: border-box;
    justify-content: center;
  }

  footer {
    box-sizing: border-box;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 90%;
    background: none;
    height: 50%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 10px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
}
}

@media screen and (max-width: 1024px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    width: 85%;
    justify-content: center;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 88%;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 88%;
    background: none;
    height: 70%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 35px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
}
}

@media screen and (max-width: 768px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .search {
    width: 88%;
    display: flex;
    justify-content: center;
  }

  footer {
    box-sizing: border-box;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 88%;
    background: none;
    height: 70%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 23px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
}

}

@media screen and (max-width: 600px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 85%;
    display: flex;
    justify-content: center;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 88%;
    background: none;
    height: 70%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 23px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
  }
}

@media screen and (max-width: 375px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 75%;
    display: flex;
    justify-content: center;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 80%;
    background: none;
    height: 80%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 20px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
  }
}

@media screen and (max-width: 411px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 75%;
    display: flex;
    justify-content: center;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 80%;
    background: none;
    height: 70%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 25px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
  }
}

@media screen and (max-width: 414px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 75%;
    display: flex;
    justify-content: center;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 80%;
    background: none;
    height: 70%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 27px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
  }
}

@media screen and (max-width: 320px) {
  .tovari_block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  footer {
    box-sizing: border-box;
  }

  .search {
    width: 75%;
    display: flex;
    justify-content: center;
  }

  #sidebar {
    display: none;
  }
  #sidebar__icon {
    display: block;
    float: right;
    margin-top: 20px;
    border-radius: 3px;
    background: #F6C010;
    color: black;
  }

  #sidebar {
    width: 80%;
    background: none;
    height: 85%;
    border-right: none;

  }

  #sidebar h3 {
    color: black;
    width: 100%;
    font-weight: 600;
    font-size: 20px;
  }

  ul li a {
    background: none;
    color: black;
    font-weight: 600;
    font-size: 17px;
    border-bottom: none;
    width: 100%;
    margin-left: 20px;
  }

  ul li a:hover {
  background: none;
  transition: 0.25s;
  color: black;
  border-bottom: 2px solid #C7C7C7;
  }
}

var sidebar = document.getElementById('sidebar');
var button = document.getElementById('sidebar__icon');
button.onclick = function() {
  sidebar.classList.toggle('sidebar__active');
}

введите сюда описание изображения


Ответы (0 шт):