hi!

I recently discovered GM for myself and I had some fun writing some
scripts. I'm trying to make one of the site more handy for me and I
need to click a button.

This seems like an old story and I've read some of the posts on this
subject here and on the internet and it seems like nothing really
works for me.

There is a form with couple of buttons and one of them is made like
this:

<form id="c_form" onsubmit="return false;" name="cform">
        <div class="buttons_continue">
                <a onclick="javascript:" href="/">
                        <img border="0" alt="continue" name="cont"
src=".../continue.jpg"/>
                </a>
        </div>
</form>

using DOM I can get to <div> element, <a> element and <img> element.

click() on either of the elements doesn't work - it complains that
click is not a function.

something like this:

var fireOnThis = [my element here];
var evObj = document.createEvent('MouseEvents');
evObj.initEvent( 'mouseup', true, true );
fireOnThis.dispatchEvent(evObj);

just returns true and does nothing. this function:

function click(elm) {
     var evt = document.createEvent('MouseEvents');
     evt.initMouseEvent('click', true, true, window, 0, 1, 1, 1, 1,
false, false, false, false, 0, null);
     elm.dispatchEvent(evt);
}

doesn't seem to do much either.

is there any way I can click on that button???

thanks, any help is appreciated!

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to