Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by ila_rigo

  1. <!DOCTYPE html>
    <p>Display "iphone" if the outherWidth is equal or less than 320px</p>
    <p id="demo">desktop</p>
    function checkOuterWidth(){
    var w = window.outerWidth;
    if (w <= 320) {
       document.getElementById("demo").innerHTML = "iphone";
    else {
       document.getElementById("demo").innerHTML = "desktop";

    i am trying to write a function to detect the browser width and, based on that, have two different results. I have looked at some examples and tried to reproduce some tutorials but at the moment it doesn't work ... suggestions and corrections are very welcome

  • Create New...