0

I have the following jquery code to toggle class :

$( document ).ready(function() {
  $(".button").click(function(){
       $("#wrapper-container").toggleClass('open-close');
    });
});

Can anyone please convert this code in pure JavaScript so that it can run with jQuery library file. Update: Clicking element don't have an id so the other example is not working.

Sourabh
  • 4,186
  • 2
  • 17
  • 16
  • 1
    Look at http://stackoverflow.com/questions/18880890/how-do-i-toggle-an-elements-class-in-pure-javascript – DFayet May 21 '16 at 11:12
  • @DFayet how can we do it without ID's – Sourabh May 21 '16 at 13:01
  • 1
    the answers of [this post](http://stackoverflow.com/questions/18880890/how-do-i-toggle-an-elements-class-in-pure-javascript) don't use ID – DFayet May 21 '16 at 13:03

0 Answers0