Setting the dropdown value in grid in javascript

i have a dropdown in a gridview with 3 items
SELECT
ACTIVE
INACTIVE

based on a condition ie if qty>0 then only dropdown selected item can be ACTIVE
else it shld be INACTIVE
i get the qty
i have the script as

if( Pqty!=0)
{

if(GVRow1.cells(Child1).childNodes(0).id.indexOf(“ddlstatus”)>0)

{

GVRow1.cells(Child1).childNodes(0).focus;
// var selection = GVRow1.cells(Child1).childNodes(0).options[GVRow1.cells(Child1).childNodes(0).selectedIndex].text;
GVRow1.cells(Child1).childNodes(0).value=“INactive”;
}
}
but i am not getting the selectedvalue changed to Inactive . o get it as active only

Gridview - what is that? A feature of some type of development program?