Adding default text to input field
Since this is 2014 you're probably looking for the placeholder attribute, and not an old-school javascript solution.

Broad strokes: Implement hook_form_alter() and add the attribute there:

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'foo') {
    $form['bar']['#attributes']['placeholder'] = t('Baz');
  }
}