SyntaxFix
Write A Post
Hire A Developer
Questions
Approach 4 (this is extension of wild coder answer)
txtName.disabled=1 // 0 for enable
<input id="txtName">