Declaring and setting variable in JavaScript
<p>I'm currently using the following JavaScript in a Google Chrome Extension to automate the 'add to cart' process for purchasing sneakers on nike.com;</p>

<pre><code>var size_i_want = "11";

function fRun()
{enter code here
// Select size option.
var sizesList=document.getElementsByName("skuAndSize")[0];
for(var i=0; i&lt;sizesList.length; i++)
{
    if(sizesList.options[i].text.trim() == size_i_want)
    {
        sizesList.selectedIndex = i;
    }
}

var aButtons = document.getElementsByTagName("button");
for(var i = 0; i &lt; aButtons.length; ++i)
{
    if(aButtons[i].className.indexOf("add-to-cart") &gt; -1)
    {
        aButtons[i].click();
    }
}
}

function fTick()
{
if(document.getElementsByName("skuAndSize")[0] != undefined)
{
    setTimeout("fRun()", 600);
    //fRun();
}else{
    setTimeout("fTick()", 300);
}
}
setTimeout("fTick()", 300);
</code></pre>

<p>This script works perfectly for nike.com in the States, however does not work correctly for nike websites in other countries like the UK and Sweden. </p>

<p>As you can probably tell I am new to JavaScript and am still researching high and low to understand the language. However I understand this comes down to the fact that</p>

<pre><code>var size_i_want = "11";
</code></pre>

<p>value is set as an integer (number) however on the Nike UK website the node that this affects contains letters, for example "UK 10.5".</p>

<p>Would somebody be able to help me declare a new variable and set it's value so that it contains both letters and numbers? I also have a feeling that this will impact the script as well, so help around that area is much appreciated too.  </p>