Adding and deleting the option values of a select element of html from javascript.

<html>
<body>
<script language="javascript">
                   
                    function setQuantity()
{


var i=0;
 var myselect=document.getElementById("mySelect");
 //alert(document.getElementById("mySelect").value);
 var len=myselect.length;



for(i=myselect.length-1; i>=0; i--)
    {

  
        myselect.options[i] = null;
    
    }




if(document.getElementById("selHomepageTile").value=="Large")
{
    var newOpt1 = new Option(1, 1);
    myselect.options[0] = newOpt1;
}

if(document.getElementById("selHomepageTile").value=="Medium")
{
for(i=3;i>=1;i--)
{


var newOpt1 = new Option(i, i);
    myselect.options[i-1] = newOpt1;
   

}
myselect.selectedIndex = 0;

}
if(document.getElementById("selHomepageTile").value=="Small")
{
for(i=12;i>=1;i--)
{
    var newOpt1 = new Option(i, i);
    myselect.options[i-1] = newOpt1;
   
    }
     myselect.selectedIndex = 0;
}
   
 }
                   
                    </script>             

<select name="selHomepageTile" id="selHomepageTile" disabled="true"  onChange="setQuantity();">
                        <option value="Large">Large (1) $200</option>
                        <option value="Medium">Medium (3) $120/each</option>
                        <option value="Small">Small (12) $80/each</option>

</select>
<select name="mySelect" id="mySelect" disabled="disabled">

           <option value="1">1</option>
</select>
</body>
</html>