getElementsByAttribute() is not a function

From documentation:

Note that this method is only available on XUL elements; it is not part of the W3C DOM.

Use this:

document.querySelectorAll("[xlink|href='"+id+"']");

Leave a Comment