我想用 javascript 禁用任何编辑器,我试试这个,但它不起作用:
<body onload="charge()">
<div class="editor-field">
<%: Html.EditorFor(model => model.Num_Serie, new { @id = "nn" })%>
</div>
</body>
和javascript代码:
<script type="text/javascript">
function charge() {
var nn = document.getElementById('nn');
nn.disabled = 'disabled';
}
</script>