Setting the Textbox read only property to true using JavaScript
问题 How do you set the Textbox read only property to true or false using JavaScript in ASP.NET? 回答1: You can try document.getElementById("textboxid").readOnly = true; 回答2: document.getElementById('textbox-id').readOnly=true should work 回答3: Try This :- set Read Only False ( Editable TextBox) document.getElementById("txtID").readOnly=false; set Read Only true(Not Editable ) var v1=document.getElementById("txtID"); v1.setAttribute("readOnly","true"); This can work on IE and Firefox also. 回答4: I