Tuesday, 15 June 2010

jquery - C# Click by tag -



jquery - C# Click by tag -

i'm trying teach myself c# programme i'm working on has browser attached it. have been trying figure out how create click button tag name cant seem to. have searched site , found many helpful topics none yet help solve one.

<a class="some_class" style="letter-spacing: -1px" href="/someurl" data-executing="0">displaybuttontext</a>

that button create programme click. cant to. here few ways have tried:

private void test1_checkedchanged_1(object sender, eventargs e) { web.document.getelementsbytagname("class").getattribute("href").invokemember("click"); }

that method didn't threw error getattribute, tried:

moco.document.getelementbyid("a").invokemember("click");

this doesn't show error doesn't click button (displaybuttontext). kind plenty show illustration , explain it. maintain in mind i'm new this.

let's have on html page:

<a id="link-id" href="linktosomewhere.html">click here</a>

you want call:

document.getelementbyid("link-id").invokemember("click");

this because link element has attribute id="link-id".

you can see in article parameter pass getelementbyid needs id of element want retrieve: http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.getelementbyid(v=vs.110).aspx

c# jquery

No comments:

Post a Comment