not able to put value in htmlelement

bhavin12300

Active member
Joined
Sep 18, 2007
Messages
44
Programming Experience
Beginner
hi i am creating one small script that just navigate to my local page and after that when i click a button it fill up the textbox on the page in my webbrowser control.
here is my button click code.
VB.NET:
Dim doc As HTMLDocument
Dim value As IHTMLElementCollection
Dim temp As IHTMLElement
Dim a As String
a = ""
Set doc = WebBrowser1.Document
a = doc.getElementById("textbox1").setAttribute("value", "bhavin")
and following is the source of my html page on which i want to perform this task.
HTML:
<html>
<body>
<input type="textbox" id="textbox1" value="">
</body>
</html>
when i use getatrribut property of the htmlelement it is perfectly fetching that value but when i try to use setAttribute method to set its value i can folowing error
VB.NET:
compile error:
Expected function or variable
so anyone help me with this?
waiting


my application is visual basic.
not in vb.net
 
SetAttribute is not a function, so a call to this method doesn't return anything, therefore it is wrong to write "a =....SetAttribute(...)", correct call is:
VB.NET:
doc.GetElementById("textbox1").SetAttribute("value", "bhavin")
 
Back
Top