Nope, the loop is the correct way to do it.  You should also probably check !elems[i].disabled if you're writing a general-purpose function.