I'm doing a project that some images have tooltip, but it only appears with the click. The problem is that the mobile version is not legal, so I need to open a new page with the contents of this tooltip. Is there any way to change onclick content according to page size?
Ex:
On the desktop it would be:
<img src="img.jpg" onclick="abre o tooltip" />
And in mobile would be:
<img src="img.jpg" onclick="location.href='abre pagina'" />