Check, using jQuery, if an element is 'display:none' or block on click

后端 未结 7 1320
我在风中等你
我在风中等你 2020-11-28 17:56

I want to check and sort elements that are hidden. Is it possible to find all elements with attribute display and value none?

相关标签:
7条回答
  • 2020-11-28 18:34

    There are two methods in jQuery to check for visibility:

    $("#selector").is(":visible")
    

    and

    $("#selector").is(":hidden")
    

    You can also execute commands based on visibility in the selector;

    $("#selector:visible").hide()
    

    or

    $("#selector:hidden").show()
    
    0 讨论(0)
提交回复
热议问题