Expand|Select|Wrap|Line Numbers
- var username = document.getElementById('username')
- function test()
- {
- document.write(username)
- }
- ...
- Username: <input type="text" id="username">
- <input type="button" value="test" onClick="test();">
When I click the button, the only thing it returns is null. Am I doing something wrong?