eliang
V2EX  ›  问与答

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

  •  
  •   eliang · Jan 30, 2020 · 1832 views
    This topic created in 2296 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   ·   5613 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 07:50 · PVG 15:50 · LAX 00:50 · JFK 03:50
    ♥ Do have faith in what you're doing.