Forecast toggle span using find()


Has anyone else done this span toggle class between glyphicon-plus glyphicon-minus . I found it tricky and instructions very confusing. I have finally manged to come up with working solutions but not sure if it's the right way but it does the job. Let me know what you think of it. Here's the mine:

var main = function() {
    $('.day').click(function() {
        var $el = $(this).find('span.glyphicon');
        $($el).toggleClass('glyphicon-plus glyphicon-minus');



You can definitely accomplish the same thing with fewer lines of code :wink:

var main = function() {
  $('').click(function() {