Ji Joe The Man
Ji Joe The Man

Reputation: 55

How to use JQuery with the C# WebBrowser control

I'm trying to perform this jquery action in my C# application : $(".icon-radiobutton").click()

I tried the following :

WebBrowser1.Document.GetElementsByName(".icon-radiobutton").InvokeMember("click")

But it seems like that's not the way to do it.

Upvotes: 1

Views: 3689

Answers (1)

Neil P
Neil P

Reputation: 3190

Write a javascript function to do it and call that using your webBrowser component

js:

function MyCLickFunction()
{
    $(".icon-radiobutton").click()
}

c#:

webBrowser1.Document.InvokeScript("MyCLickFunction");

Upvotes: 2

Related Questions