addEventListenner Probleme

Hello Clever’s
I’m getting an “.addEventListener is not a function” error. I am stuck on this:
HTML

<div class="container">
            <nav class="nav">
                <div class="menu-toggle">
                    <i class="fas fa-bars"></i>
                    <i class="fas fa-times"></i>
                </div>
                <a href="index.html"><img src="/images/logo.png" alt=""></a>
                <ul class="nav-list">
                    <li class="nav-item">
                        <a href="#" class="nav-link">Home</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">Menu</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">Reservations</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">News</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">Shop</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">Contact</a>
                    </li>
                </ul>
            </nav>

and this JS Code :cry: :sob: :sob:


    const selectElement = function (element) {
    return document.querySelector(element);
    };
    
    let menuToggler = selectElement('.menu-toggle');
    let body = selectElement('body');
    
    menuToggler.addEventListenner ("click", function() {
    body.classList.toggle('open');
    });

but In Console Say
"
Uncaught TypeError: menuToggler.addEventListenner is not a function
at main.js:14
"
can anyone give me solution please
THX

You have a typo, it’s just one ‘n’:
addEventListener

1 Like

thx bro
this is a Stupid Mistake from Beginner hhhh :rofl: :rofl: :rofl: :rofl: :rofl: :joy: