Seems like Mastodon escapes the HTML bits before JS loads them in (like it does on a normal browser), so that didn't work. I got a successful webmention from my blog to my blog using another blogpost, though:
https://aashvik.com/posts/testing-webmentions