Java text

Hi, I am trying to allow the user to click on a hyperlink, i want this then to bring up more hyperlinks in same element(replacing the hyperlinks that are already there) i.e
if it inititialy contained hyperlinks A B C D
I want to then replace that and have hyperlinks AA BB CC DD instead.
I need them to come up in the same place though, could you tell me is this possible using java and if so where would I start ( I don’t actually need the code, just how to start i.e. if I reference the list “initial list” can I somehow use OnClick to replace the code in “initial list” with code in "final list"
thanks in advance