ortunado β 17-21 Nov 8
Could anyone have idea, how to manage querySelectorAll to select all input elements, but not the ones inside another form? For example,
29 Replies
The easiest would be to use
element.closest()
but could there be any other way?Which inputs do you want here?
Can you annotate them please
Edited the original message.
This is the current version with JS, would like to not use
element.closest
Query selector CSS power πͺ that's really nice π digging around doing a React 18 upgrade but I probably would've come up with something a bit worse anyway
And we need remove last small thing.
Right now any depth.
π
Beautiful bit of DOM work there
Also we can merge rules:
And form cannot be in form.
Can you merge query selector selectors like that in the same way you can merge CSS ruleset selectors?
I never knew that
Right.
Damn, TIL
<a:7119_Jotaro_Dancing:608310437955502146>
Haven't had to work with the DOM at a low level for a few years now but that's wicked!
Although as an aside, I don't think it's semantically correct to nest forms anyway so π€·ββοΈ
Same, now lying in bed a little sick recovered it from memory and docs.
The days before querySelector were doom and gloom
The DOM methods are so powerful but god forbid I have to work with them at that low a level again