freezing-crowd-50703
06/08/2021, 10:16 PMfreezing-crowd-50703
06/08/2021, 10:16 PMmysterious-toddler-20573
06/08/2021, 10:16 PMfreezing-crowd-50703
06/08/2021, 10:16 PMmysterious-toddler-20573
06/08/2021, 10:17 PMfreezing-crowd-50703
06/08/2021, 10:17 PMfreezing-crowd-50703
06/08/2021, 10:20 PMgorgeous-airport-54386
06/09/2021, 12:29 AMhx-trigger="load"gorgeous-ghost-95789
06/09/2021, 12:32 AMgorgeous-ghost-95789
06/09/2021, 12:33 AMgorgeous-ghost-95789
06/09/2021, 12:34 AMadamant-exabyte-92636
06/09/2021, 12:20 PMmysterious-toddler-20573
06/09/2021, 2:11 PMgorgeous-ghost-95789
06/09/2021, 2:15 PMmysterious-toddler-20573
06/09/2021, 4:20 PMnext expression be? I often run into this situation where I have a class toggle that is in the DOM somewhere, and I want it to toggle the class on the next instance of a class or element type. I can add an ID to that thing, but that ruins the regularity of the DOM. A situation like this:
html
<div>
<span _="on click toggle .foo on next .bar">Toggle</span>
</div>
<div>
<div class="bar">
...
</div>
</div>mysterious-toddler-20573
06/09/2021, 4:21 PMnext (and previous) would both do a depth-first scan along the DOM for a matching elementmysterious-toddler-20573
06/09/2021, 4:21 PMmysterious-toddler-20573
06/09/2021, 4:23 PMmysterious-toddler-20573
06/09/2021, 4:23 PMmysterious-toddler-20573
06/09/2021, 4:24 PMon keydown[key is 'ArrowDown'] from <input/> in me
set nextInput to the next <input/> from its parentElement
if nextInput
call nextInput.focus()
halt
endmysterious-toddler-20573
06/09/2021, 4:25 PMgorgeous-ghost-95789
06/09/2021, 4:25 PMmysterious-toddler-20573
06/09/2021, 4:25 PMgorgeous-ghost-95789
06/09/2021, 4:26 PMgorgeous-airport-54386
06/09/2021, 4:26 PM<$it ~ input/>mysterious-toddler-20573
06/09/2021, 4:26 PMgorgeous-airport-54386
06/09/2021, 4:26 PMgorgeous-airport-54386
06/09/2021, 4:27 PMa ~ b : b's positioned anywhere after a's, but having the same parentmysterious-toddler-20573
06/09/2021, 4:27 PMgorgeous-airport-54386
06/09/2021, 4:28 PMdiv
div
div
div.cls
div.cls + div, div.cls ~ div
div.cls ~ div