riddle me this, batman

if i have this code in my javascript

document.addEventListener("load", function() {
document.getElementById("place-a-pin").addEventListener("click", useAddress);
});

why is there no event listener on #place-a-pin

Follow

@monorail oh yeah i always forget where the event listener goes with load events

document.addEventListener("DOMContentLoaded", ...) might be better if you don't need to wait for assets but it's nbd

@Lady it is probably better that it's waiting actually, it won't work until an embedded google map loads

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.