Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

<div class="container" onclick="myFunction(this)"> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> </div> <script> function myFunction(x) { x.classList.toggle("change"); }

Hungry Hawk answered on February 8, 2020 Popularity 3/10 Helpfulness 1/10

Contents


More Related Answers

  • 3.How to toggle a class for an element?
  • const burgerToggle = document.querySelector('.menu').onclick = toggleMenu; function toggleMenu () { document.querySelector('#show').classList.toggle('show'); document.querySelector('.hamburger').classList.toggle('close'); }; i want to put this code i

  • <div class="container" onclick="myFunction(this)"> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> </div> <script> function myFunction(x) { x.classList.toggle("change"); }

    0
    Popularity 3/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 08 2020
    Hungry Hawk
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.