Javascript: get all links without using jQuery