KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to change the maxlength of a textbox with JavaScript or jQuery: I tried the following but it didn't seem to help: var a = document.getElementsByTagName('input'); for(var i=0; i<a.length; i++) { if((a[i].type!= 'radio')||(a[i].type!= 'checkbox')) a[i].maxlength = 5; } document.getElementsByTagName('input')[1].maxlength="3"; $().ready(function() { $("#inputID").maxlength(6); }); What am I doing wrong?
Tags (comma-separated)
Save Edits
Cancel