Yes but you would not be able to actually empress this in C. Not possible! The best you could do would be something like:
void set_class_to_blue(Element* ele)
{
set_class(ele, "blue");
}
foreach(dom, "a", set_class_to_blue);
Any if you inline the code, you can see what it does line for line and translate it to ASM.
Take the JQuery in contrast. That does the $("a") actually do? It creates an object that contains a classifier that may later evaluate to DOM nodes. On this object you then can call function; theses functions then operate on all instances. So the statement $("a").addClass("blue") is semantically equivalent to $('a').forEach(function (ele) {ele.setClass("blue");}). But it is not implemented in the same way. Even if you inline all the JS code, it will be hard to break it down to actual processor instructions (just the VM), because half of the time a semantic construction does nothing useful.