eliang
V2EX  ›  问与答

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

  •  
  •   eliang · Jan 30, 2020 · 2237 views
    This topic created in 2472 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
    Mutoo
    Jan 30, 2020❤️1
    1
    document.querySelectorAll('g[transform]:last-of-type > rect:last-child')
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1807 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 09:44 · PVG 17:44 · LAX 01:44 · JFK 04:44
    ♥ Do have faith in what you're doing.