V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
eliang
V2EX  ›  问与答

用纯 css 选择器的方式获取 github commit 的最后一格 block

  •  
  •   eliang · Jan 30, 2020 · 1800 views
    This topic created in 2283 days ago, the information mentioned may be changed or developed.

    16ff61a0dab23f76 16ff61b4f5ed0324 16ff61bdce69aa05

    想问一下 我这里想获取最后一个方块

    document.querySelector('.js-calendar-graph-svg>g g:last-child rect:last-child')
    

    这么写感觉没有问题呀,可是为啥获取不到呢?

    1 replies    2020-01-30 19:27:40 +08:00
    Mutoo
        1
    Mutoo  
       Jan 30, 2020   ❤️ 1
    document.querySelectorAll('g[transform]:last-of-type > rect:last-child')
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1485 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.