Talk:Generate Click Events: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Created page with 'at the end: > Assume that the el variable points to some element which we want to "click on": > > var evt = document.createEvent("HTMLEvents"); > evt.initEvent("click", true, t…'
 
No edit summary
Line 2: Line 2:


> Assume that the el variable points to some element which we want to "click on":
> Assume that the el variable points to some element which we want to "click on":
>
 
> var evt = document.createEvent("HTMLEvents");
> var evt = document.createEvent("HTMLEvents");
> evt.initEvent("click", true, true);
> evt.initEvent("click", true, true);
> link.dispatchEvent(evt);
> link.dispatchEvent(evt);


there is no "el variable", is "link" the right reference???
there is no "el variable", is "link" the right reference???


I don't want to change anything unless I'm sure that I'm right.
I don't want to change anything unless I'm sure that I'm right.

Revision as of 07:39, 1 June 2010

at the end:

> Assume that the el variable points to some element which we want to "click on":

> var evt = document.createEvent("HTMLEvents");

> evt.initEvent("click", true, true);

> link.dispatchEvent(evt);


there is no "el variable", is "link" the right reference???

I don't want to change anything unless I'm sure that I'm right.