drop down menu - How to select a value from the dropdown list using javascript -


i trying select value dropdown list site http://www.snapdeal.com/product/samsung-galaxy-grand-duos-i9082/638689?hid=productgrid_mobiles_1

code used :

var obj = document.getelementbyid('attribute-select-0');      obj.options[1].selected = true; 

if manually select dropdown see href , other attributes of below div changes change dropdown value

console.log(document.getelementbyid('buybutton-1').href); 

issue yhe issue facing selecting dropdown value using code have mentioned above still not getting change expected value in console.log(document.getelementbyid('buybutton-1').href);

edit have tried :

obj.selectedindex = 'white'; 

but same result.

dont know doing wrong

$("#attribute-select-0").val("white"); 

or plain javascript:

document.getelementbyid("attribute-select-0").value="white"; 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -