JS function for selecting everything in an element.

I can't remember what this is for, but I figure there's no problem with
keeping it.