How do I use an Onchange event to change html by getElementById?

John P

New member
If I use this code:
<script language="JavaScript"> document.getElementById("foo").maxLength = 100;</script> then I can set maxLength of a textbox using Javascript.

I want to be able to have a select box and use an onchange event so that the maxLength attribute is changed to match the value of the option chosen in the select box.

Any ideas?
Thanks!
 
Back
Top