Before introducing some javascript examples, let's begin by creating a table and using it to organize our response options in a more uniform manner. This isn't necessary, but I find it helpful and perhaps you will too.

1. I like coffee.
Strongly Disagree
Disagree
Agree
Strongly Aisagree



Now, let's use two javascript events to highlight the table row (i.e., response option) the user is currently mousing over. We will also include an event to de-highlight the row when the mouse leaves. We accomplish this with the onMouseover and onMouseout event handlers. We also change the appearance of the mouse via this.style.cursor='pointer'.

onMouseover="this.bgColor='gray'"; Something happens when there is a mouseover event. What happens? "This" object's bgColor property is set to gray. "This" is a short-hand way of referencing the current object. We could also refer to it by its proper name.

2a. I like black coffee.
Strongly Disagree
Disagree
Agree
Strongly Aisagree


This part does the same thing, but shows how to reference the document object by name rather than via "this." Notice that we give each table row an ID of either "fancy1" "fancy2" "fancy3" or "fancy4" and then control the properties of those objects.

2b. I like fancy coffee.
Strongly Disagree
Disagree
Agree
Strongly Aisagree



Let's make the entire table row function like a radio button. In other words, when a user clicks anywhere in the relevant row, the appropriate button is filled.

3. I like red eyes--drip coffee with a shot of esspresso.
Strongly Disagree
Disagree
Agree
Strongly Aisagree