JS widgets or macros to set content in HTML

Check website online or offline as a badge widget is an example of updating HTML, it do an async fetch, and update the content.

But I haven’t see how it is done, it is written by Claude4.5.