Hopefully I can explain it well enough. I do
var foo = document.getElementsByTagName('bar');
var len = foo.length;
for(var i=0;i<len;i++){
//Do stuff
}
Inside that for I also want to be able to get an element (specifically a class) that is buried deep within foo[i]. My thought is something like
var whatIWant = document.getElementsByClassName("name").foo[i];
but that doesn’t seem to be what I need to do. Am I just not sure on the syntax or do I need to do something completely different?
You’ve almost got it:
If you were using jquery, it’d be as simple as: