Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.

DOM array "anchors" contains anchors with "name" attribute only, not those with "id" attribute, in contrast to IE-8.

  • 1 baphendule
  • 1 inale nkinga
  • 1 view
  • Igcine ukuphendulwa ngu cor-el

more options

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)

more options

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 ngu cor-el