hiep.lq
hiep.lq

Reputation: 53

Get return value of function javascript on webbrowser

I have a javascript function:

function getData(){
   return document.getElementById("xx").value;
}

I use HtmlElement to append code in html and use webbrowser invokescript to run function getData().

I want to get return value of getData() and show it on messageBox.

Upvotes: 3

Views: 5647

Answers (1)

Slashy
Slashy

Reputation: 1881

You can simply assign it into a string variable

  String str = doc.InvokeScript("getData").ToString(); 

Upvotes: 6

Related Questions