Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: tabIndex to Input Object ?? Date: Tue, 16 Jul 2013 18:36:54 -0600 Lines: 43 Message-ID: References: X-Trace: individual.net hhYnvN5IrTy2gHfWhbAUxAYM6x/2tYMrKws36i+Gp1wSPaJDMP Cancel-Lock: sha1:J+8XWa+PW+orJz6i30x+IkZYzhQ= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: csiph.com comp.lang.javascript:20683 JJ said: >> nextobj = convertToObject(mytable,newtabIndex) {/* ???*/ } > > AFAIK, DOM doesn't provide a property/function to list all focusable > elements, so you'll have to manually search it. One example is to use > "document.querySelector" (using CSS selector). e.g.: > > function convertToObject(elementId, tabIndex) { > //return null if not found > return document.QuerySelector( > '#' + elementId + ' input[tabindex="' + tabIndex + '"]' > ); > } > var ele = convertToObject("mytable", 123); > if (ele) { > console.log(ele.value); > } else { > console.log("Element not found"); > } Hi JJ: I should have said that each of these text input boxes are part of the cells of a table, and have no 'id' property (yet). This is because rows can be added and deleted, and the input elements in each new row would have to be given unique ids. But after a row is inserted or deleted, I *do* run a function to reset the tabIndexes of each of the input text boxes to start at 201 and proceed upto approx 260. My mind 'blows up' when I try to think of a way to assign them all unique IDs so that my editing function will know how to move Up/Down/TopRow/BottomRow, etc -- with the input of an Up-Arrow,Dn-Arrow, PageUp, PageDn, etc, etc, Carriage Return, etc. Thanks for coming to my rescue -- again ! I'll think more on it and try to use the QuerySelector. -Mel