html - using javascript find div tag display property is none or block or undefined - Stack Overflow

using that code i am able to find tag display properybut i want to get all the tag which have their di

using that code i am able to find tag display propery but i want to get all the tag which have their display property none.Give me the result using javascript or jquery

document.getElementById('MSO_ContentTable').style.display

MSO_ContentTable is an id of div tag

using that code i am able to find tag display propery but i want to get all the tag which have their display property none.Give me the result using javascript or jquery

document.getElementById('MSO_ContentTable').style.display

MSO_ContentTable is an id of div tag

Share Improve this question asked Jul 19, 2011 at 7:50 V_BV_B 1,5695 gold badges18 silver badges39 bronze badges 3
  • You want to find all hidden tags? What are you trying to achieve, what's the end goal? – Shef Commented Jul 19, 2011 at 7:55
  • i am calculating total word in html page . i want to remove all the tag from calculation which have their display property none – V_B Commented Jul 19, 2011 at 7:58
  • Gave you an answer. With that selector you will find all the hidden elements of the page. – Shef Commented Jul 19, 2011 at 8:09
Add a ment  | 

5 Answers 5

Reset to default 3
$('div').filter(function() {
    return $(this).css('display') == 'none'; //or whatever you want to filter.
})

See it in action.

$(':hidden')

That should do just fine for you.

Using jQuery you can try the below code to find all the elements which are hidden on the page

$("*").is(":hidden").not("input:hidden");

If a jquery solution is okay you could do:

     $('*:not(:visible)')

this returns a collection of all non visible objects in the dom.

These are elements that:

  • They have a CSS display value of none.
  • They are form elements with type="hidden".
  • Their width and height are explicitly set to 0.
  • An ancestor element is hidden, so the element is not shown on the page

You could filter out only those with "display:none" by iterating on them

Try this code : $("#MSO_ContentTable").css("display","none"); Using Jquery , All document by id "MSO_ContentTable" is Gone ....

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745125644a4612675.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信