Check div is hidden using jquery

前端 未结 6 1087
故里飘歌
故里飘歌 2021-02-01 14:46

This is my div

Then I have a Show button that will show the div when you click:

6条回答
  •  悲&欢浪女
    2021-02-01 15:05

    Try checking for the :visible property instead.

    if($('#car2').not(':visible'))
    {
        alert('car 2 is hidden');       
    }
    

提交回复
热议问题