Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Denis McMahon Newsgroups: comp.lang.javascript Subject: Re: document.elementname vs document.getElementById("id") Date: Sun, 30 Sep 2012 13:14:43 +0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 30 Sep 2012 13:14:43 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="986f797cbd3b8f473a4775d73e9098bc"; logging-data="3499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hKbW1uRZN24n/tNSdMoY5Efqt00aU/Pw=" User-Agent: Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2) Cancel-Lock: sha1:vcDUQAOm8X1YO5EmQIPkOeJk9hQ= Xref: csiph.com comp.lang.javascript:16272 On Sun, 30 Sep 2012 11:02:52 +0300, Jukka K. Korpela wrote: > The short answer is: change your habits but not existing code. For new > pages, use the modern, logical way. For old pages, remember that any fix > will introduce errors with a nonignorable probability, so don't do fixes > just to "clean things up" Ah But the existing code is broken: document.all.formname Very Senior Coder but not a web guy thinks that because it works now on his browser of choice, document.formname is a valid fix I'm arguing that the correct fix is to convert broken document.all.formname to document.getElementById("formid") and assign ids to forms as appropriate. i.e. this isn't cleaning things up for the sake of it, this is fixing currently broken code. Rgds Denis McMahon