CsQuery icon indicating copy to clipboard operation
CsQuery copied to clipboard

Is there an element.click()

Open brendonco opened this issue 9 years ago • 6 comments

Hi,

Is there an element.click() ?

e.g. CQ dom = CQ.Create(HTML); dom["#myelementbutton"].click();

If yes, how to implement an element click?

brendonco avatar Mar 11 '15 07:03 brendonco

There is not an click event, remember you are not executing the javascript. What are you exactly trying to do with the click?

tellez12 avatar Mar 11 '15 09:03 tellez12

I'm trying to execute a JS function inside the JavaScript file similar to JQuery click(). If it not possible with CQ, do you have a better idea in mind?

brendonco avatar Mar 13 '15 01:03 brendonco

CsQuery is really a tool for manipulating and parsing HTML using similar syntax as the jQuery library. "click" events and the like aren't really applicable in that sense.

like @tellez12 said, "you are not executing the javascript".

If you're trying to do unit testing of your javascript, use Jasmine. If you're trying to have server-side code trigger an event in javascript, use SignalR.

If there's something else you're trying to accomplish, please explain.

rondefreitas avatar Mar 13 '15 20:03 rondefreitas

I also need this functionality to automate form filling and submission. JQuery also has form.submit

radenkozec avatar Mar 17 '15 18:03 radenkozec

Once again: CsQuery is NOT a javascript engine. It does not run javascript. It is an HTML parser. It has no knowledge of DOM events.

jamietre avatar Mar 17 '15 19:03 jamietre

Thanks for highlighting the use of CSQuery.

brendonco avatar Apr 08 '15 02:04 brendonco