atribut readonly di html oleh javascript

document.getElementById("yourID").readOnly = true; 
Mr. Samy