Get all elements with `position:fixed` in an HTML page?

前端 未结 4 1080
梦毁少年i
梦毁少年i 2021-01-05 03:07

Reason for doing that: I\'m debugging css of my webpage.. some elements appeared and they\'re not supposed to appear. I suspect it is the issue with element positioning.. th

4条回答
  •  广开言路
    2021-01-05 03:39

    document.querySelector('*[style="position:fixed"]')

    The * item specifies all tag names. The [] indicate that you're looking for an attribute. You want your style attribute to have position:fixed.

    If you aren't using jQuery, this is probably going to be your simplest option.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题