How to change a form dropdown list selection using a method

I've got a form with a few dropdowns that are associated to static lists.  I need to drive the selection of the dropdowns to update based upon a graphic that's made of multiple HTML fields (basically a 5x5 grid).

- Dropdown1

- Dropdown2

Each grid box should have a value associated to the two dropdowns.

So what I want to do, is run a method onClick (or onSelect?) of the HTML fields, changing the selection of Dropdown1 and Dropdown2.

Looked through the various guides and couldn't find something applicable.  Could anyone assist with this?