Change DIV contents using jQuery when link clicked

后端 未结 6 1552
梦毁少年i
梦毁少年i 2021-01-26 02:15

Thank you, in advance, for those who answer =)
I\'m trying to switch between divs when i click the links with the respective class (as follow on the code bellow). It works f

6条回答
  •  盖世英雄少女心
    2021-01-26 02:53

    $('#cont').click(function(e) {
      e.preventDefault();
      var idToSlide = $(this).attr('class');
      $('#' + idToSlide).slideToggle(500);
    });
    

提交回复
热议问题