Piper Thunstrom on Nostr: So I had a bad thought, and went and tested it. Want the jquery node lookup syntax ...
So I had a bad thought, and went and tested it.
Want the jquery node lookup syntax but want to use the browser APIs directly?
`let $ = document.querySelectorAll.bind(document)`
You won't get the mutation methods or the animations, but you do get:
`$("#my-cool-thing")`
which returns a NodeList.
Do with this cursed code as you will.
#javascript #vanilla
Published at
2025-09-23 17:25:34 UTCEvent JSON
{
"id": "adeffac68f20dae86a6e61aff0d8ed583f9f6cecf55a1b3ded9e7e38e7291f74",
"pubkey": "7318768caea96dabe0a0e343076d167b2242da851a51d4af0f1801b2477bfb7c",
"created_at": 1758648334,
"kind": 1,
"tags": [
[
"proxy",
"https://ngmx.com/@pathunstrom/115254777272570278",
"web"
],
[
"t",
"javascript"
],
[
"t",
"my"
],
[
"t",
"vanilla"
],
[
"proxy",
"https://ngmx.com/users/pathunstrom/statuses/115254777272570278",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://ngmx.com/users/pathunstrom/statuses/115254777272570278",
"pink.momostr"
],
[
"-"
]
],
"content": "So I had a bad thought, and went and tested it.\n\nWant the jquery node lookup syntax but want to use the browser APIs directly?\n\n`let $ = document.querySelectorAll.bind(document)`\n\nYou won't get the mutation methods or the animations, but you do get:\n\n`$(\"#my-cool-thing\")`\n\nwhich returns a NodeList.\n\nDo with this cursed code as you will.\n\n#javascript #vanilla",
"sig": "3612dedac639c07178ebd728e18da97c58f24ddd9b5b02157ce5ef3a0b2b740ca139992ff66c1e83935a19b770a9c38f445a4a93016d4be14d0eea0183fdfe4c"
}