Doesn't exist. But I would love that it did. 2 days ago, I made search for it, I found this one pearl of a function, you just called it and it would perform just that. Today, I can't find it for heavens. I have been through about 5 fiddle's, about 10 '00-looking webpages, Mozilla homepages, some document.Prototype
then alert($("div[invoker='MyInvoker']"));
, empty arrays with enumeration without relation/reference, nodes list without names or objects and lots of others. I've visited first 3 pages of Google for query "getElementsByAttribute JavaScript", "getElementsByAttribute jQuery" and couple others, until results became extremely irrelevant. I know it's possible, because I had that script, but I thought I'd remove it for now, as it stands in my way and I could find it easy anyways. It had same principle like any getElementBy*
family member:
var el = getElementById("that_one_div");
el.innerHTML = "This will be the content of that one div";
alert ("The content of that DIV is: + el.innerHTML);
But with attributes instead:
var el = getElementByAttribute("attribute", "value");
el.innerHTML = "This will be the content because you have been marked with this attribute.";
alert("Content of the element: " + el.innerHTML);
Has anybody found it maybe? Or may have such snippet laying under his/her hand? I use Node.js, JavaScript (of course) and latest jQuery provided by Google API.