For a page ("Bill4Time"), the Dashboard shows a table for displaying time entries and entering a new time entry but several control elements do not have ID's associated with them. Interestingly enough, the control to add a new time entry line (an icon of a clipboard with a small plus sign in the lower right hand corner) always has the same index number (so I can select it with Document.all("index_no")
to add a new time entry. But once you edit that line by entering a new time entry, the control icon changes (to a generic clipboard, like all the other time entries in the table) and the index becomes dynamic -- and there is no id associated with that control. However, I found that the parent element (i.e., the table cell) does have a unique ID which never changes (while it is the most recently added time entry) so currently I go to it (using Document.getElementByID("unique_id").focus()
) and then send a {tab} to move over to the control element (and send {enter} to go to the correct details page).
If I could get the index number of the unique_id element, and increment that by one, I could more reliably get to the control I want, so my question is, if one has gotten a DOM element by id, how can one find its index number?
When I search here (or google) I get a lot of results for finding the index of the included elements within the parent, or results based on .selectedIndex and the like, and I suppose I could loop through all the DOM elements until I find the one with ID = unique_id
, but there should be a better way to get an index number of a selected element.
TIA,
At least if doing it with IE and AutoHotkey this will give you the index
index := wb.document.getElementByID("unique_id").sourceIndex
But you don't need the index if you have the parent element
element := wb.document.getElementByID("unique_id").childnodes[0]
Also a lot of times elements that don't have an ID often have a Name or Class attribute, both of them can also be used to find the element you need...
We'd like to have two outputs from Webpack - our entire app with all of its dependencies, and a single different page with only one dependency (that isn't shared by the main app). It seems the way ...
We'd like to have two outputs from Webpack - our entire app with all of its dependencies, and a single different page with only one dependency (that isn't shared by the main app). It seems the way ...
I have a search box which should work with pressing the button and also pressing the Enter key. They both have the same code. The button works perfectly but when it comes to the Enter key, most of the ...
I have a search box which should work with pressing the button and also pressing the Enter key. They both have the same code. The button works perfectly but when it comes to the Enter key, most of the ...
I'm trying to do something I don't remember/find if it is possible in javascript. I have an object constructor "Point" and I want to know if it possible to, for example, sum two different objects ...
I'm trying to do something I don't remember/find if it is possible in javascript. I have an object constructor "Point" and I want to know if it possible to, for example, sum two different objects ...
I'm trying to start a git repo when scaffolding an application with a yeoman custom generator, this is what I got at the install step: install: function () { this.installDependencies(); ...
I'm trying to start a git repo when scaffolding an application with a yeoman custom generator, this is what I got at the install step: install: function () { this.installDependencies(); ...