How to insert data into an input without ID from visual basic?

1

I have this problem, currently the code runs fine as long as the html element has an ID, the thing is that the text box that I want to put the data has no ID, it only has class.

Code that works if you only have id:

WebBrowser1.Document.GetElementById("username").SetAttribute("value", User_abaol.Text)

Element where I want to insert data.

< input class="login" value="texto a insetar"/ >

How can I insert it if the html text box does not have an ID.

    
asked by Abaol 24.07.2017 в 03:02
source

1 answer

0

Resolve it like this:

WebBrowser1.Document.GetElementByClassName("login").SetAttribute("value", User_abaol.Text);

You can also check in the w3Schools that have a little explanation ...

    
answered by 09.11.2018 в 12:32