I have a winform and a WebBrowser control and I am changing an option in select HTML control.
webBrowser1.Document
.GetElementsByTagName("select")[4]
.GetElementsByTagName("option")[13]
.SetAttribute("selected", "true");
Now it works and selects the required option, but it does not fire the onchange event. The select does not have an element id but it does have a class name.
I tried:
webBrowser1.Document
.GetElementsByTagName("select")[4]
.RaiseEvent("onchange");
and
webBrowser1.Document
.GetElementsByTagName("select")[4]
.GetElementsByTagName("option")[13]
.RaiseEvent("onchange");
But in vain.
I tried and sent a TAB key after selecting an option and it raised the onchange event.
Everything is good now.