My goal I need to choose the second option.
I tried the following approach and cannot set the selected value. The error does not appear, the choice simply does not occur. I myself am very familiar with HTML, I know that "selected" and "selected =" selected "are selected, but I do not know why it does not work with my C # code. What could be wrong?
webBrowser1.Document.GetElementById("field_gender1"). Children[1].SetAttribute("selected", "selected");
HTML
<select name="gender1" id="field_gender1" class="select"> <option selected="selected" value="1">val1</option> <option value="2">val2</option> </select>
source share