Doing so isn't the best of ideas. By writing your code that way you couple your script to the structure of the document. If the document structure changes, your script breaks. Assigning unique ids to the elements make your script structure-independent.
That said, sometimes you just gotta do it by inspection. Your best bet is to get a good HTML DOM reference so you can see what each element exports as properties that you can use to inspect the structure and find the element(s) that you want.