Automatically close all the other
tags after opening a specific
tag

前端 未结 6 508
日久生厌
日久生厌 2021-02-06 01:08

Here is my code.



        
6条回答
  •  深忆病人
    2021-02-06 01:30

    Same concept, just a bit shorter.

    $('details').click(function (event) {
        $('details').not(this).removeAttr("open");  
    });
    

提交回复
热议问题