Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had a job interview once where the question was "find all descendants of a DOM node with a certain tag name, and return them in document order." I thought for about 30 seconds, and then wrote up on the board:

    element.getElementsByTagName(tagName);
That was what he was looking for. ;-) Of course, then he had me do it out as if getElementsByTagName didn't exist.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: