dwr.util.getValue(id)

dwr.util.getValue(id) is the read version of setValue(). This gets the values out of the HTML elements without you needing to worry about how a selection list differs from a div.

This method works for most HTML elements including selects (where the option with a matching value and not text is selected), input elements (including textareas) divs and spans.

For example:

dwr.util.getValue( )
Returns " " (Press 'getValue').

HTML Test Elements

A div element with id="div".
Text area (id="textarea"): Selection list (id="select"):
Text input (id="text"): Password input (id="password"):
Form button (id="formbutton"): Fancy button (id="button"):