3

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.

2
  • is it a function which aleardy exits on the site? Commented Aug 15, 2015 at 18:21
  • It not exits on the site. I use HtmlElement to append it in code. I can run it but i don't know to get return value of it. Commented Aug 15, 2015 at 18:25

1 Answer 1

6

You can simply assign it into a string variable

  String str = doc.InvokeScript("getData").ToString(); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.