<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>both scripts works exactly the same way.
the difference is I like using named constants and @avg uses literals. named constants are self-documented.
teorically, &lt;code&gt;XPathResult.FIRST_ORDERED_NODE_TYPE&lt;/code&gt; takes a little more time because it's ordered. This is why I use &lt;code&gt;XPathResult.ANY_UNORDERED_NODE_TYPE&lt;/code&gt;.

change the line:&lt;pre&gt;e.target.form.elements.namedItem('Submit').click();&lt;/pre&gt;
to:&lt;pre&gt;e.target.form.submit();&lt;/pre&gt;
This will prevent from triggering the onclick event</body>
  <body-html>&lt;p&gt;both scripts works exactly the same way.
&lt;br /&gt;the difference is I like using named constants and @avg uses literals. named constants are self-documented.
&lt;br /&gt;teorically, &lt;code&gt;XPathResult.FIRST_ORDERED_NODE_TYPE&lt;/code&gt; takes a little more time because it's ordered. This is why I use &lt;code&gt;XPathResult.ANY_UNORDERED_NODE_TYPE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;change the line:&lt;pre&gt;e.target.form.elements.namedItem('Submit').click();&lt;/pre&gt;
&lt;br /&gt;to:&lt;pre&gt;e.target.form.submit();&lt;/pre&gt;
&lt;br /&gt;This will prevent from triggering the onclick event&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-11-09T11:44:33Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">17315</id>
  <topic-id type="integer">9596</topic-id>
  <updated-at type="datetime">2008-11-09T13:08:33Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">55607</user-id>
</post>
