title: how i can call the matchmedia function without changing browser dimensions
body: <p>i'm not very good in javascript, but i tried this function.</p>
  
  <pre><code>&lt;script&gt; 
  
  function myFunction(divswitch) {
    if (divswitch.matches) { // If media query matches
  
    } else {
  
    }
  }
  
  var divswitch = window.matchMedia("(max-width: 640px)")
  myFunction(divswitch) // Call listener function 
  divswitch.addListener(myFunction) // Attach listener 
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The Script only called if the user switch their browser dimensions. 
  could someone fix the code for users, which doenst switch their browser dimensions. its for screens smaller than 640 px like mobile phones.</p>