title: How to select a value from the dropdown list using javascript
body: <p>I am trying to select the a value from the dropdown list from the site <a href="http://www.snapdeal.com/product/samsung-galaxy-grand-duos-i9082/638689?HID=productGrid_mobiles_1" rel="nofollow">http://www.snapdeal.com/product/samsung-galaxy-grand-duos-i9082/638689?HID=productGrid_mobiles_1</a></p>
  
  <p>Code used : </p>
  
  <pre><code>var obj = document.getElementById('attribute-select-0'); 
      obj.options[1].selected = true;
  </code></pre>
  
  <p>If you manually select the from the dropdown you will see that the href and other attributes of the below div changes as you change the dropdown value</p>
  
  <pre><code>console.log(document.getElementById('BuyButton-1').href);
  </code></pre>
  
  <p><strong>ISSUE</strong> Yhe issue I am facing is that am selecting the dropdown value using the code that i have mentioned above but still am not getting the change expected value in the console.log(document.getElementById('BuyButton-1').href);</p>
  
  <p><strong>EDIT</strong> Have also tried :</p>
  
  <pre><code>obj.selectedIndex = 'White';
  </code></pre>
  
  <p>But same result.</p>
  
  <p>Dont know where am i doing wrong</p>