Hi

I strucked with emails adding to the textarea. I used following code.

Code:
   function addTo( emailAddr )
  {
    console.log('hi***'+document.emailForm.toAddr.value); // this prints empty  but it goes to else block.
    if ( document.emailForm.toAddr.value == ' ' )
      document.emailForm.toAddr.value = emailAddr;
    else
       // document.emailForm.toAddr.value = emailAddr;
       document.emailForm.toAddr.value += ', ' + emailAddr; 
  }
what's wrong in the above code.
Can any body give an Idea.

Thanks in advance...