TS中readonly的设置方法

动态设置readonly的方法

    document.getElementById(`test`).setAttribute('readonly','true');
    document.getElementById(`test`).removeAttribute('readonly');    

不能使用 setAttribute('readonly','false');  这样无效

posted @ 2020-04-22 16:42  白小江  阅读(1534)  评论(0编辑  收藏  举报