Atributo de lectura en HTML por JavaScript
document.getElementById("yourID").readOnly = true;
Mr. Samy
document.getElementById("yourID").readOnly = true;
document.getElementById("myElementId").setAttribute("readonly", "readonly");
document.getElementById("myElementId").removeAttribute("readonly");