Checking for internet connection

Hi Kirupians

I’m looking for a way to detect if there’s still internet connection? -and if not, then publish a message saying “Whoops, looks like there’s no internet connection, please …”.

My own guess would be some HTML code, but I can’t really find anything suitable for my case.

Thanks :afro: