Use javascript to change the href of a button depending on screensize
<p>I made a fluid grid based website, and now i want to add movie content within an iframe. Since the iframe is changeing size, i made the content i want to add in these 3 sizes:</p>

<p>-option1 size: 720p: 1280 x 720<br>
-option2 size: 480p: 854 x 480<br>
-option3 size: 360p: 640 x 360</p>

<p>now i'm looking for a script to measure the screen of the user, and then to change the href of the button to option 1, 2 or 3.</p>

<p>This is how far i come. i hope someone has an example. </p>

<pre><code>&lt;a target="iframe_cinema" onclick="myFunction() href="option1" id="window"  class="button2 white"&gt;
            &lt;img src="images/3D.png"&lt;/div&gt;&lt;/a&gt;

&lt;script&gt;
function myFunction()
{

var x=window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;


if (Width&lt;640)
  {
  x="option1";
  }
else if (Width&lt;854)
  {
  x="option2";
  }
else
  {
  x="option3";
  }

&lt;/script&gt;
</code></pre>

<p>thanks in advance.</p>
