change attribute to selected

change attribute to selected

I have two multiselect listboxes on my page, both with a different classname.
 
I also have two href's links on my page. What i want is when i click on the first link that all the options are checked in the first multiselect listbox. If i click on the second then all the options should get checked in the second multiselect listbox.
 
Can someone please tell me how to do that??