tags:

views:

23

answers:

1

How can I assign the contents of a form text field called "username" which is in the first form in a document to a variable called "thename"

+2  A: 

Did you try this?

var thename=document.getElementById(<textFieldId>).value
Aviator