DOM array "anchors" contains anchors with "name" attribute only, not those with "id" attribute, in contrast to IE-8.
Trying to list all anchors of a web page that used (somewhat inconsistently) "id" and "name" as identifiers of anchors, I noticed that Firefox misses the anchors with "id = ...", whereas IE-8 lists all of them correctly. Can this be fixed or circumvented?
Trying to list all anchors of a web page that used (somewhat inconsistently) "id" and "name" as identifiers of anchors, I noticed that Firefox misses the anchors with "id = ...", whereas IE-8 lists all of them correctly. Can this be fixed or circumvented?
All Replies (1)
See https://developer.mozilla.org/en/DOM/document.anchors
A possibility is to use document.getElementsByTagName("A") and check for a name and id:
A=(a.name)?a.name:(a.id)?a.id:''; if(A){T+=A+'<br>'}
Okulungisiwe