It actually should.
Any HTML element can have an ID, ie. <input type="text" name="textfield" id="textfield">
It can then be called in Javascript by the getElementById function, like so: document.getElementById("textfield")
I'm not sure why your way isn't working, though. Try with any browser, perhaps?