How do I disable TextBox using JavaScript?

前端 未结 4 964
时光说笑
时光说笑 2021-02-01 23:15

earlier I asked for help disabling a Button when a drop down menu item was selected. I was given some code that did the trick but now I need the same with a Textbox and for some

4条回答
  •  一整个雨季
    2021-02-02 00:01

    You can use disabled attribute to disable the textbox.

    document.getElementById('color').disabled = true;
    

提交回复
热议问题