Check if element is visible in DOM

后端 未结 18 1924

Is there any way that I can check if an element is visible in pure JS (no jQuery) ?

So, for example, in this page: Performance Bikes, if you hover over Deals (on the

18条回答
  •  青春惊慌失措
    2020-11-22 08:11

    This is what I did:

    HTML & CSS: Made the element hidden by default

    
    
    
    
    
     
    
    
     
    

    JavaScript: Added a code to check whether the visibility is hidden or not:

    
    

提交回复
热议问题