You should try to use dynamic dns (DDNS) service. Even the cheapest routers are providing that service. It shouldn’t be hard to find free service and after setting it up, your friend can just ping yours subdomain (for IP) or use hostname.
Example, for tp-link: http://www.tp-link.com/en/faq-297.html
It is not possible to achieve that with HTML as it runs on client computer (yours friend computer).
1
solved Is there a way of displaying my dynamic public IP with html? [closed]