v0lkan/o2.js — Issue #30: o2.DomHelper.get*** methods should be able to select more than one classname, id, tags etc.
Author: v0lkan
Created: 2011-10-19 06:20:22+00:00
State: open

this may be a duplicate issue.

for instance

o2.DomHelper.getElementsByClassName(node, 'class1, class2');

should return all the inner nodes with "class1" OR "class2" as a classname.

o2.DomHelper.getElementsByClassName(node, 'class1 class2');

should return all the inner nodes with "class1" AND "class2" as a classname.

All the getters should be revised accordingly.

The end-result will NOT be a sizzle-like selector engine, though. Because giving too much selector freedom ofter results in a performance sacrifice. -- In fact, imho in 99% of the cases document.getElementById is the best selector possible. -- and if one does not bother to give a darn ID to their elements, they are in the wrong path, and I do not want to lead them further into that path.