how to toggle (hide/show) a table onClick of tag in java script

前端 未结 8 2087
青春惊慌失措
青春惊慌失措 2021-02-05 13:24

I want to show and hide (toggle) the

onClick event of the . this is my tag

&         


        
      
      
      
8条回答
  •  情书的邮戳
    2021-02-05 13:28

    You are always passing in true to the toggleMethod, so it will always "show" the table. I would create a global variable that you can flip inside the toggle method instead.

    Alternatively you can check the visibility state of the table instead of an explicit variable

提交回复
热议问题