How to toggle element visibility without jQuery?

后端 未结 4 1396
猫巷女王i
猫巷女王i 2021-01-12 22:26

I\'m writing an auction template for eBay, hoping that eBay would allow it. Apparently they don\'t because jquery has things like string.replace() etc.

The code is v

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-12 22:48

    I had issues with the interval approach. This is what I came up with.

    function showHide() {
      var element = document.getElementById('hiddenDetails');
      element.classList.toggle("hidden");
    }
    .hidden {
      display: none;
    }
    
    .show {
      display: block;
    }
    Get Details
    
    

提交回复
热议问题