By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

Method of element identification and emulation of click event

P: n/a
I wish to uniquely identify the below button element embedded
among many other button elements in a web page and call the click
event on it to automatically navigate to the next page in a
sequence of pages. Similar in action to automated login.

<INPUT class=submitn onclick="window.location='/newstuff?
newstuffupdate=prefs&amp;type=cfilter&amp;index=1& amp;from=zzyzx'"
type=button value="Search Now">
Since the above button element has no id or name tag I can't see
any way of success with;
var tag=document.getElementById("foo").click()";

Also, if it matters, this input element and many others of the
class=submitn are not wrapped in a <form</formblock, they do
all reside in a <div</divblock.

http://www.javascriptkit.com/domref/...tmethods.shtml
does have a close approximation of what could be used.

Under heading - getElementsByName(name)

<div name="george">f</div>
<div name="george">f</div>

<script type="text/javascript">
var georges=document.getElementsByName("george")
for (i=0; i< georges.length; i++)
// do something with each DIV tag with name="george". Firefox only.
</script>

but the above still leaves the identification of the input
button unsolved.

Any insights or suggestions?
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It should be added that the client browser is written in java with IE
engine embedded in a java ContentPane. The client user may inject into
any rendered webpage any javascript that a user may wish as though the
injected script were part of the original downloaded webpage.

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.