How to click a javascript button

I would like to be able to click this. I am coding in C # and I am using the built in firefox cefsharp. I came across the code below and I would like to click it if I can. For reference: Definition of ExecuteScriptAsync.

public void ExecuteScriptAsync(string script);

      

This allows me to write javascript. Combined with a browser after visiting a web page. For example, it allows me to fill out an email form and a password form and click "Login".

browser.ExecuteScriptAsync("document.getElementById('Email').value=" + '\'' + txtEmail.Text + '\'');   
browser.ExecuteScriptAsync("document.getElementById('Passwd').value=" + '\'' + txtPassword.Text + '\'');     
browser.ExecuteScriptAsync("document.getElementById('signIn').click()");

      

Below is what I would like to click if possible.

<button class="KjTtD twEJfe uq" title="Call a phone">

    <div class="rYvKwe"></div>

</button>

      

As long as I can click the mouse. To get the above code, I used the Firefox firefox checker element. I've tried several different ways to click it.

As below.

browser.ExecuteScriptAsync("$('#button a:eq(1)').click();");

      

and

browser.ExecuteScriptAsync("document.getElementByTitle('Call a phone').click()");

      

Is it even possible to click on it? If so, can someone point me in the right direction? Thank!

+3
javascript jquery c # cefsharp


source to share


No one has answered this question yet

Check out similar questions:

7728
How do I redirect to another web page?
7649
How does JavaScript blocking work?
7494
How can I remove a specific element from an array in JavaScript?
7432
How to check if a string contains a substring in JavaScript?
7428
How can I check if an element is hidden in jQuery?
7287
What does "use strict" do in JavaScript, and what are the reasons for it?
5722
How can I remove a property from a JavaScript object?
5670
Which operator is equal (== vs ===) should be used in JavaScript comparisons?
4829
How do I include a JavaScript file in another JavaScript file?
3998
How to validate an email address in JavaScript



All Articles
Loading...
X
Show
Funny
Dev
Pics