How to add some javascript in a form using form API?
drupal_add_js() is for adding script tags to the page.
It doesn't go in a form element.

 drupal_add_js('alert("Hello!")', 'inline');


would go by itself on a line. This would add that javascript to the page, so when the page loads you would get a pop-up that says "Hello".

and/or to add markup to the page you would do this:

$form['target'] = array(
  '#prefix' =&gt; '&lt;div id="newuser"&gt;',
  '#value' =&gt; t('Hello'),
  '#suffix' =&gt; '&lt;/div&gt;'
);


Which would add the text "Hello" to the form in the newuser div.