I'm trying to run a JavaScript function on a webpage from my C# codes.
This is the code from the website:
<div class="class34" onclick="sendpost(8);"></div><div class="class34" onclick="sendpost(9);"></div>
function sendpost(valg) {
valget = {};
valget.rane = valg
poststuff('snas',valget, function(back) {
$('#return').html(back.html);
});
}
And this is the code I've tried to run it in C#:
webBrowser1.Document.InvokeScript("sendpost(8)");
and the result is that the code does nothing, I've been searching for the correct code to use but can't figure out what I'm doing wrong here.
How can I make my webBrowser1 either click or run the sendpost(8) function?