How do I disable TextBox using JavaScript?

前端 未结 4 971
时光说笑
时光说笑 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条回答
  •  猫巷女王i
    2021-02-02 00:15

    Here was my solution:

    Markup:

    Javascript:

    document.getElementById("name").disabled = true;
    

    This the best solution for my applications - hope this helps!

提交回复
热议问题