<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040090" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040090</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/i-hate-javascript#comment-1226327</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;teammatt3;226298 wrote:&lt;/strong&gt; Why is document.getElementById better than just going stepping through the elements on the page? Is it because the browsers have different ideas on what certain elements are and getElementById works right every time? Is it faster?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It&#039;s similar to HTML standards.  The &lt;a href=&quot;http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html&quot; class=&quot;bb-url&quot;&gt;Document Object Model 2 Core&lt;/a&gt; is a standard produced by the W3C, specifying [incode]getElementById[/incode] among other things.  This should work in exactly the same way everywhere (and probably does).  There is no guarantee of it being faster or slower.&lt;/p&gt;
&lt;p&gt;The code you were using, however, is non-standard, and was the traditional way of doing things in the absence of a compliant DOM implementation.  Its behaviour naturally varies with every user agent.&lt;/p&gt;
&lt;p&gt;Unfortunately, there is a lot of existing documentation and code that doesn&#039;t use the recommended DOM standard, so you&#039;re quite likely to be misinformed if you look at outdated sources.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 13 Nov 2007 20:44:33 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1226327 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/i-hate-javascript#comment-1226298</link>
    <description> &lt;p&gt;Thanks, the getElementById thing works!&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: Fyi, what you hate is not Javascript but rather the DOM. And you probably hate the DOM because you&#039;re not using it correctly. What you should be using is something like the following:
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Why is document.getElementById better than just going stepping through the elements on the page? Is it because the browsers have different ideas on what certain elements are and getElementById works right every time? Is it faster?&lt;/p&gt;
 </description>
     <pubDate>Mon, 12 Nov 2007 16:43:43 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1226298 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/i-hate-javascript#comment-1226277</link>
    <description> &lt;p&gt;It works for me in Konqueror but not in Firefox.  The reason is that they have different ideas of what document.regform.&lt;strong&gt;regex&lt;/strong&gt; means.  Konqueror thinks it&#039;s the input field (as you do) but Firefox thinks it&#039;s the fieldset named regex.  So document.regform.regex[1].value should work instead.  But it may break in other browsers.&lt;/p&gt;
&lt;p&gt;Fyi, what you hate is not Javascript but rather the DOM.  And you probably hate the DOM because you&#039;re not using it correctly.  What you should be using is something like the following:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;amp;gt;&lt;br /&gt;function validate() &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = document.getElementById(&amp;quot;regex&amp;quot;).value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(value)&lt;br /&gt;}&lt;br /&gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form name=&amp;quot;regform&amp;quot;&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;fieldset id=&amp;quot;regexset&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;legend&amp;gt;Regular Expression&amp;lt;/legend&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;regex&amp;quot; name=&amp;quot;regex&amp;quot; onkeyup=&amp;quot;validate()&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/fieldset&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 12 Nov 2007 07:36:39 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1226277 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
