uwp Using JavaScript in WebView

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


This document shows you how you can use JavaScript in WebView.

This document cover: Getting HTML from the WebView, Entering text in the text box on the website, Simulate click to click a website button


  • await webView.InvokeScriptAsync("eval", new string[] { functionString }) - to use JavaScript
  • .documentElement - to get a reference to the root node of the document
  • .getElementsByClassName(Class_Name) - to get elements usign Class Name
  • .getElementsByTagName(Tab_Name) - to get elements using Tag Name
  • .getElementById(ID) - to get element using ID
  • .nodeName - to get the node name
  • .childNodes - to get the child elements
  • .outerHTML - to Get the Outer HTML
  • .innerHTML - to Get the Inner HTML
  • .innerText - to Get or Set InnerText
  • .click() - to Simulate click


Got any uwp Question?