This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.



Smartphone icons created by Freepik - Flaticon

JS addEventListener()

This example uses the addEventListener() method on the window object.

Try resizing this browser window to trigger the "resize" event handler.

window.addEventListener("resize", function(){
  document.getElementById("demo").innerHTML = Math.random();
});